High School Computer Science

Networks and the Internet网络与互联网

Every time you load a webpage, stream a video, or send a message, data travels across a web of interconnected devices governed by precise rules called protocols. This guide explains how networks are built (LAN, WAN, topologies), how the Internet breaks data into packets and routes them across the globe, how IP addresses and DNS let you reach any machine by name, what TCP/IP and HTTP/HTTPS actually do, how the OSI seven-layer model organises those rules, and how firewalls and encryption keep traffic safe. It closes by untangling the Web from the Internet itself.每当你加载网页、播放视频或发送消息,数据都在由精确规则(协议,protocol)控制的互联设备网络中传输。本指南讲解网络(network,网络)的构建方式(局域网 LAN、广域网 WAN、拓扑结构),互联网(Internet,互联网)如何将数据拆成数据包(packet,数据包)并路由到全球各地,IP地址(IP address,IP地址)和域名系统(DNS,域名系统)如何让你用名字访问任何机器,TCP/IP 和 HTTP/HTTPS 实际上做什么,OSI 七层模型如何组织这些规则,以及防火墙(firewall,防火墙)和加密如何保护流量安全。最后辨析万维网(Web)与互联网本身的区别。

7 sections7 节内容 US CSTA · AP CSP · ON · BC CIS · ABUS CSTA · AP CSP · ON · BC CIS · AB ASCII diagrams · no KaTeXASCII 图示 · 无 KaTeX

What is a Network?什么是网络?

Learning objectives学习目标
  • Define a network, a LAN and a WAN, and tell LAN from WAN by geographic scope and ownership.
  • Draw and label a star topology, and name the bus, ring and mesh topologies with one strength or weakness of each.
  • Calculate how many links a star and a full mesh need for n devices.
  • Explain what a single point of failure is and say which topology has one.
  • Choose a topology for a given scenario and justify the choice.
  • 定义网络、局域网(LAN)和广域网(WAN),并按地理范围和所有权区分局域网与广域网。
  • 画出并标注星型拓扑,说出总线型、环型和网状型拓扑,并各举一个优点或缺点。
  • 计算 n 台设备的星型拓扑和全网状拓扑各需要多少条链路。
  • 解释什么是单点故障(single point of failure),并指出哪种拓扑存在单点故障。
  • 为给定场景选择拓扑并说明理由。
Key definitions: memorise these first.核心定义:先背这些。
  • Network网络: two or more devices connected so they can share data and resources. BC Computer Studies 10 Content: "wired and wireless computer networking (network cards, routers, switches, cables, modems, network types).":两台或更多设备相互连接以共享数据和资源。BC Computer Studies 10 内容:"有线和无线计算机网络(网卡、路由器、交换机、电缆、调制解调器、网络类型)。"
  • LAN (Local Area Network)局域网(LAN): a network confined to a small geographic area, e.g. one building or campus. Devices connect via Ethernet cable or Wi-Fi. High speed, privately owned.:局限于较小地理区域(如一栋建筑或校园)的网络。设备通过以太网线缆或 Wi-Fi 连接。速度快,私有。
  • WAN (Wide Area Network)广域网(WAN): a network spanning a large geographic area, linking LANs together. The Internet is the world's largest WAN. BC CIS 11 Content (verbatim): "model-wide area networks (WANs) and local area networks (LANs).":跨越大地理区域、将多个局域网连接在一起的网络。互联网是世界上最大的广域网。BC CIS 11 内容(原文):"广域网(WAN)和局域网(LAN)模型。"
  • Network topology拓扑结构: the arrangement of how devices are connected. Common topologies: bus (all on one cable), star (all connect to a central switch, most common today), ring (each device connects to the next), mesh (every device connects to every other, fault tolerant, used in WANs). CSTA 3A-NI-04: "relationship between routers, switches, servers, topology, and addressing.":设备连接方式的排布。常见拓扑:总线型(所有设备连一条电缆)、星型(所有设备连接到中央交换机,当今最常见)、环型(每台设备连接到下一台)、网状型(每台设备与其他所有设备连接,容错性强,用于广域网)。CSTA 3A-NI-04:"路由器、交换机、服务器、拓扑结构和寻址之间的关系。"
Worked Example 1: Reading a star topology例题 1:读懂星型拓扑

Star topology (most common in modern LANs): all devices connect to one central switch or router.星型拓扑(现代局域网最常见):所有设备连接到一个中央交换机或路由器。

  PC1 ----+
          |
  PC2 ----+---- Switch/Router ---- Internet
          |
  PC3 ----+
          |
 Printer--+

In a star topology, if the central switch fails, all devices lose connectivity; the switch is a single point of failure. In a mesh topology, data can reroute around failed nodes, making it fault-tolerant. CSTA 3A-NI-04 asks you to "evaluate the scalability and reliability of networks"; topology is a key factor.在星型拓扑中,若中央交换机故障,所有设备失去连接,交换机是单点故障。在网状拓扑中,数据可以绕过故障节点重新路由,因此具有容错性。CSTA 3A-NI-04 要求你"评估网络的可扩展性和可靠性",拓扑结构是关键因素。

Worked Example 2: Link counts for a star and a full mesh例题 2:星型与全网状的链路数

A computer lab has 6 devices. (a) How many cables does a star topology need? (b) How many links does a full mesh need? (c) Repeat both for a campus with 20 devices. (d) What does the mesh buy you, and what does it cost?一间机房有 6 台设备。(a)星型拓扑需要多少条线缆?(b)全网状拓扑需要多少条链路?(c)对有 20 台设备的校园重复(a)和(b)。(d)网状拓扑带来什么好处,又付出什么代价?

(a) Star. Every device has one cable to the central switch, so the number of cables equals the number of devices: 6 devices need 6 cables.(a) 星型。每台设备各用一条线缆连到中央交换机,所以线缆数等于设备数:6 台设备需要 6 条线缆。

(b) Full mesh. Every pair of devices gets its own link. There are n choices for one end and n − 1 for the other, and each pair is counted twice, so links = n × (n − 1) ÷ 2. For 6 devices: 6 × 5 ÷ 2 = 15 links.(b) 全网状。每一对设备都有一条独立链路。一端有 n 种选择,另一端有 n − 1 种,而每一对被数了两次,所以链路数 = n × (n − 1) ÷ 2。6 台设备:6 × 5 ÷ 2 = 15 条链路。

(c) 20 devices. Star: 20 cables. Mesh: 20 × 19 ÷ 2 = 190 links. Check with code:(c) 20 台设备。星型:20 条线缆。网状:20 × 19 ÷ 2 = 190 条链路。用代码验证:

for n in (6, 20):
    star = n
    mesh = n * (n - 1) // 2
    print(n, star, mesh)

# output:
# 6 6 15
# 20 20 190

(d) Tradeoff. In a mesh, if one link fails the data can take another path, so no single failure cuts anyone off. The cost grows with the square of the number of devices: going from 6 to 20 devices (about 3.3 times as many) raises the links from 15 to 190 (about 12.7 times as many). A star stays cheap, but the switch is a single point of failure: if it fails, all devices lose connectivity, while a broken cable disconnects only one device. Real networks often use a partial mesh as a compromise.(d) 权衡。在网状拓扑中,某条链路故障时数据可以走另一条路径,所以任何单点故障都不会让某台设备断网。成本随设备数的平方增长:设备从 6 台增至 20 台(约 3.3 倍),链路从 15 条增至 190 条(约 12.7 倍)。星型一直很便宜,但交换机是单点故障:交换机坏了,所有设备都断网,而一条线缆断了只会让一台设备断网。现实中的网络常用部分网状作为折中。

Why this works: a topology is a counting problem plus a failure question. Count the links to see the cost, then ask what happens when one part fails.为什么这样做:拓扑既是计数问题,也是故障问题。先数链路得到成本,再问某一部分故障时会怎样。

Exam tip考试提示

When a question says distinguish LAN from WAN, give both sides: a LAN covers one building or campus and is privately owned; a WAN covers a large area and links LANs together. The number of devices does not decide it: a hospital with 200 devices in one building is still a LAN. When it says draw, label the central switch and every device. Common error: saying the cable is the weak point of a star topology; the switch is.

题目说区分(distinguish)局域网和广域网时,两边都要写:局域网覆盖一栋建筑或一个校园,属于私有;广域网覆盖大范围并把多个局域网连起来。设备数量不能决定类型:一栋楼里有 200 台设备的医院仍然是局域网。题目说画图(draw)时,要标出中央交换机和每台设备。常见错误:说星型拓扑的薄弱点是线缆,其实是交换机。

Check your understanding自我检测
Define LAN and WAN, and say which one the Internet is.定义局域网和广域网,并说明互联网属于哪一种。

A LAN (local area network) covers a small area such as one building or campus and is usually privately owned. A WAN (wide area network) spans a large area and links LANs together. The Internet is the largest WAN.

局域网(LAN)覆盖一栋建筑或一个校园这样的小范围,通常是私有的。广域网(WAN)跨越大范围,把多个局域网连在一起。互联网是最大的广域网。

A hospital has 200 devices in one building, all connected through switches. Is this a LAN or a WAN? Why?一家医院在同一栋楼里有 200 台设备,全部通过交换机相连。这是局域网还是广域网?为什么?

It is a LAN. What matters is geographic scope and ownership (one building, privately owned), not the number of devices. If the hospital also linked three buildings across the city with leased lines, those long links would form a WAN.

这是局域网。关键是地理范围和所有权(一栋楼、私有),而不是设备数量。如果医院再用专线连接全城的三栋楼,这些远距离链路就构成广域网。

How many links does a ring of 8 devices need, and how many does a full mesh of 8 devices need? Which one is more expensive?8 台设备的环型拓扑需要多少条链路?8 台设备的全网状拓扑呢?哪个更贵?

Ring: each device connects to the next and the last connects back to the first, so 8 links. Full mesh: 8 × 7 ÷ 2 = 28 links. The mesh is more expensive (3.5 times the links) but has many alternative paths.

环型:每台设备连到下一台,最后一台再连回第一台,共 8 条链路。全网状:8 × 7 ÷ 2 = 28 条链路。网状更贵(链路是环型的 3.5 倍),但有很多备用路径。

A small clinic wants to add devices easily, and a broken cable should disconnect only one device. Which topology fits, and what is its weakness?一家小诊所希望方便地增加设备,并且一条线缆断了只应让一台设备断网。哪种拓扑合适?它的弱点是什么?

A star topology. Each device has its own cable to the switch, so adding a device means one new cable and a broken cable affects one device. The weakness is the central switch, a single point of failure.

星型拓扑。每台设备都有一条自己的线缆连到交换机,所以增加设备只需一条新线缆,一条线缆断了只影响一台设备。弱点是中央交换机,它是单点故障。

A school's computers are all connected to one central switch in the building. What type of network is this, and what topology does it use?学校的所有计算机都连接到大楼内一台中央交换机。这是什么类型的网络,使用什么拓扑结构?
§1 · Q1
WAN / mesh topology广域网 / 网状拓扑
LAN / bus topology局域网 / 总线拓扑
LAN / star topology局域网 / 星型拓扑
WAN / star topology广域网 / 星型拓扑
One building = LAN (local area network). All devices connecting to a single central switch = star topology. WAN spans a large geographic area; bus topology uses one shared cable.一栋建筑 = 局域网(LAN)。所有设备连接到单一中央交换机 = 星型拓扑。广域网跨越大地理区域;总线拓扑使用一条共享电缆。
One building = LAN. All devices to one central switch = star. Mesh = every device to every other; bus = one shared cable; WAN = large geographic area.一栋建筑 = 局域网。所有设备连一台中央交换机 = 星型。网状 = 每台设备与其他所有设备连接;总线 = 一条共享电缆;广域网 = 大地理区域。
Which network topology is most fault-tolerant because data can reroute around failed nodes?哪种网络拓扑因数据可以绕过故障节点重新路由而最具容错性?
§1 · Q2
Bus总线型
Star星型
Ring环型
Mesh网状型
Mesh topology connects every device to every other, so if one link fails, data can be rerouted through other paths. This is why the Internet itself uses a mesh-like structure for resilience.网状拓扑将每台设备与其他所有设备连接,因此若某条链路故障,数据可通过其他路径重新路由。这就是互联网本身采用类似网状结构以保证弹性的原因。
Mesh = multiple paths between any two nodes = fault tolerant. Star has one central point of failure. Bus has one shared cable that fails all devices if broken. Ring fails if one device goes down.网状型 = 任意两节点间有多条路径 = 容错。星型有一个中央故障点。总线型有一条共享电缆,断裂则所有设备失连。环型一台设备故障则全线中断。

The Internet and How Data Travels互联网与数据的传输方式

Learning objectives学习目标
  • Define a packet and name the header fields it carries (source IP, destination IP, sequence number).
  • Explain three benefits of packet switching and how a receiver reorders packets.
  • Calculate how many packets a file needs from its size and the payload per packet.
  • Calculate transfer time = size ÷ bandwidth, converting bytes to bits and Mbps to MB/s.
  • Distinguish bandwidth from latency and say which one a given problem is about.
  • 定义数据包(packet),并说出它头部携带的字段(源 IP、目标 IP、序列号)。
  • 解释分组交换的三个优势,以及接收方如何给数据包重新排序。
  • 根据文件大小和每个数据包的载荷量,计算需要多少个数据包。
  • 计算传输时间 = 大小 ÷ 带宽,并完成字节到比特、Mbps 到 MB/s 的换算。
  • 区分带宽(bandwidth)与延迟(latency),并判断一个问题讲的是哪一个。
Why packets? Why not send the whole file at once?为什么用数据包?为什么不一次性发送整个文件?
  • Packet数据包: a small chunk of data, typically 1,500 bytes or less, with a header containing the sender's IP address, the destination IP address, the packet number, and total packet count. AP CSP Big Idea 4 (CSN) describes the Internet as a network of networks that sends data as packets.:一小块数据,通常不超过 1,500 字节,头部包含发送方 IP 地址、目标 IP 地址、数据包编号和总包数。AP CSP 大概念 4(CSN)把互联网描述为网络的网络,数据以数据包形式传输。
  • Packet switching分组交换: each packet can take a different route to the destination. Routers forward each packet along whichever path is fastest at that moment. Packets are reassembled in order at the destination.:每个数据包可以走不同路径到达目的地。路由器将每个数据包沿当时最快的路径转发。数据包在目的地按序重新组装。
  • Fault tolerance容错性: because packets can reroute around failed nodes, the Internet continues to work even when some routers go down. AP CSP topic 4.2 (Fault Tolerance) covers this. CSTA 3A-NI-04: "evaluate the scalability and reliability of networks.":因为数据包可以绕过故障节点重新路由,即使某些路由器宕机,互联网仍能继续工作。AP CSP 主题 4.2(容错)涵盖此内容。CSTA 3A-NI-04:"评估网络的可扩展性和可靠性。"
Why packets beat one big stream: (1) multiple packets can travel simultaneously on different paths; parallel throughput; (2) if one packet is lost, only that packet is retransmitted, not the whole file; (3) bandwidth is shared fairly across many simultaneous users.为什么数据包优于单一大流:(1)多个数据包可同时在不同路径传输,并行吞吐;(2)若某个数据包丢失,只需重传该数据包而非整个文件;(3)带宽可在众多并发用户间公平共享。
Worked Example 3: Following a 3-packet message例题 3:跟踪一条 3 包消息

Sending a 3-packet message from your laptop to a web server.从你的笔记本电脑向 Web 服务器发送一条 3 包消息。

Your Laptop
  |
  | Packets 1, 2, 3 (may take different routes)
  v
Router A ---Pkt1---> Router C ---Pkt1---> Web Server
  |                               ^
  +---Pkt2---> Router B ---Pkt2---+
  |                               |
  +---Pkt3---> Router D ---Pkt3---+
                (third route)

Web Server: receives Pkt3, Pkt1, Pkt2 (out of order)
            reassembles in order using packet numbers
            sends ACK (acknowledgement) for each packet

Each router reads the destination IP address on the packet header and forwards the packet toward the destination via the best available route. The web server uses the packet-number field to reorder packets even if they arrive out of sequence. This is packet switching in action.每台路由器读取数据包头部的目标 IP 地址,并通过当前最佳可用路由将数据包转发至目的地。Web 服务器利用数据包编号字段对数据包重新排序,即使它们不按顺序到达也没关系。这就是分组交换的实际运作。

Worked Example 4: Packet counts and transfer time例题 4:数据包数量与传输时间

A 3 MB file (take 1 MB = 1,000,000 bytes) is sent over a link with bandwidth 8 Mbps and one-way latency 40 ms. Each packet is at most 1,500 bytes: 1,460 bytes of data (the payload) plus 40 bytes of headers. (a) How many packets are needed? (b) What is the ideal transfer time, ignoring headers? (c) What is it once headers are counted? (d) When does the last bit arrive? (e) If 12 packets are lost, how many bytes must be resent?一个 3 MB 的文件(取 1 MB = 1,000,000 字节)通过带宽 8 Mbps、单向延迟 40 ms 的链路发送。每个数据包最多 1,500 字节:1,460 字节数据(载荷)加 40 字节头部。(a)需要多少个数据包?(b)忽略头部时,理想传输时间是多少?(c)计入头部后是多少?(d)最后一个比特何时到达?(e)如果丢了 12 个数据包,需要重传多少字节?

(a) Packets. 3,000,000 ÷ 1,460 = 2,054.79, and a fraction of a packet still needs a whole packet, so round up: 2,055 packets. Check: 2,054 full packets carry 2,054 × 1,460 = 2,998,840 bytes, and the last one carries the remaining 3,000,000 − 2,998,840 = 1,160 bytes.(a) 数据包数。3,000,000 ÷ 1,460 = 2,054.79,不足一个包的部分也要占一个完整的包,所以向上取整:2,055 个数据包。验证:2,054 个满包携带 2,054 × 1,460 = 2,998,840 字节,最后一个包携带剩余的 3,000,000 − 2,998,840 = 1,160 字节。

(b) Ideal time. Bandwidth is in bits per second, the file is in bytes, so convert first: 3,000,000 bytes × 8 = 24,000,000 bits. Time = 24,000,000 ÷ 8,000,000 = 3.0 s. (Mbps means megabits per second; 8 Mbps = 1 MB/s, so 3 MB takes 3 s.)(b) 理想时间。带宽的单位是比特每秒,文件的单位是字节,所以先换算:3,000,000 字节 × 8 = 24,000,000 比特。时间 = 24,000,000 ÷ 8,000,000 = 3.0 秒。(Mbps 是兆比特每秒;8 Mbps = 1 MB/s,所以 3 MB 需要 3 秒。)

(c) With headers. 2,054 packets of 1,500 bytes plus a last packet of 1,160 + 40 = 1,200 bytes: 2,054 × 1,500 + 1,200 = 3,082,200 bytes on the wire. Time = 3,082,200 × 8 ÷ 8,000,000 = 3.0822 s, about 3.08 s.(c) 计入头部。2,054 个 1,500 字节的包,加上最后一个 1,160 + 40 = 1,200 字节的包:2,054 × 1,500 + 1,200 = 3,082,200 字节在线路上传输。时间 = 3,082,200 × 8 ÷ 8,000,000 = 3.0822 秒,约 3.08 秒。

(d) Latency. Latency is a delay that does not depend on file size. The last bit leaves after 3.0822 s and needs 40 ms to travel: 3.0822 + 0.040 = 3.1222 s, about 3.12 s (ignoring acknowledgements and the slow start of a real connection).(d) 延迟。延迟是与文件大小无关的时间。最后一个比特在 3.0822 秒后发出,再用 40 毫秒传到对方:3.0822 + 0.040 = 3.1222 秒,约 3.12 秒(忽略确认包和真实连接的慢启动)。

(e) Loss. Only the lost packets are resent: 12 × 1,500 = 18,000 bytes, which is 12 of 2,055 packets (0.58%), not the whole 3 MB. The code below repeats parts (a) to (d):(e) 丢包。只需重传丢失的数据包:12 × 1,500 = 18,000 字节,即 2,055 个包中的 12 个(0.58%),而不是整个 3 MB。下面的代码重复 (a) 到 (d) 的计算:

import math

file_bytes = 3_000_000        # 3 MB, taking 1 MB = 10**6 bytes
payload = 1460                # data bytes per packet (1500-byte packet minus 40 header bytes)
header = 40                   # 20 bytes IP + 20 bytes TCP

packets = math.ceil(file_bytes / payload)
last_payload = file_bytes - (packets - 1) * payload
wire_bytes = (packets - 1) * (payload + header) + (last_payload + header)

link_bps = 8_000_000          # 8 Mbps = 8 million bits per second
ideal_s = file_bytes * 8 / link_bps
real_s = wire_bytes * 8 / link_bps

print("packets:", packets)
print("last payload:", last_payload)
print("bytes on the wire:", wire_bytes)
print("ideal time (s):", ideal_s)
print("with headers (s):", real_s)
print("plus 40 ms latency (s):", round(real_s + 0.040, 4))

# output:
# packets: 2055
# last payload: 1160
# bytes on the wire: 3082200
# ideal time (s): 3.0
# with headers (s): 3.0822
# plus 40 ms latency (s): 3.1222

Bandwidth versus latency. Doubling the bandwidth to 16 Mbps halves the 3.0 s of sending time to 1.5 s, but the 40 ms latency is unchanged. For one 1,500-byte packet the sending time is only 1,500 × 8 ÷ 8,000,000 = 1.5 ms, so latency (40 ms) dominates: a bigger pipe does not make a short message arrive sooner. If 1 MB meant 220 = 1,048,576 bytes instead, the file would be 3,145,728 bytes and the ideal time 3.1457 s; always say which meaning you use.带宽与延迟。把带宽翻倍到 16 Mbps,3.0 秒的发送时间减半为 1.5 秒,但 40 毫秒的延迟不变。对一个 1,500 字节的包,发送时间只有 1,500 × 8 ÷ 8,000,000 = 1.5 毫秒,所以延迟(40 毫秒)占主导:更宽的管道不会让短消息更快到达。如果 1 MB 取 220 = 1,048,576 字节,文件就是 3,145,728 字节,理想时间为 3.1457 秒;务必说明你用的是哪一种含义。

Why this works: convert to the same unit (bits), divide size by bandwidth, then add latency separately because it is a delay, not a rate.为什么这样做:先统一单位(比特),用大小除以带宽,再单独加上延迟,因为延迟是一段时间,而不是速率。

Exam tip考试提示

For a calculate question, write the unit conversion as its own line (bytes × 8 = bits; Mbps means megabits per second) and say whether 1 MB is 106 or 220 bytes. For explain why the Internet uses packets, give all three benefits: parallel routes, only lost packets are resent, bandwidth is shared. Common errors: mixing bytes and bits in one formula, reading Mbps as MB/s (they differ by a factor of 8), and treating latency as if more bandwidth would fix it.

遇到计算(calculate)题,把单位换算单独写成一行(字节 × 8 = 比特;Mbps 指兆比特每秒),并说明 1 MB 取 106 还是 220 字节。遇到解释互联网为什么使用数据包时,三个优势都要写:并行路径、只重传丢失的包、带宽共享。常见错误:在同一个公式里混用字节和比特,把 Mbps 当成 MB/s(两者相差 8 倍),以及以为增加带宽就能解决延迟。

Check your understanding自我检测
A 12 MB file (1 MB = 1,000,000 bytes) is downloaded over a 96 Mbps connection. What is the ideal download time?一个 12 MB 的文件(1 MB = 1,000,000 字节)通过 96 Mbps 的连接下载。理想下载时间是多少?

12 MB = 12,000,000 bytes × 8 = 96,000,000 bits. Time = 96,000,000 ÷ 96,000,000 = 1.0 s. (96 Mbps is 12 MB/s, so 12 MB takes 1 s.)

12 MB = 12,000,000 字节 × 8 = 96,000,000 比特。时间 = 96,000,000 ÷ 96,000,000 = 1.0 秒。(96 Mbps 等于 12 MB/s,所以 12 MB 需要 1 秒。)

A message of 10,000 bytes is split into packets with at most 1,460 bytes of data each. How many packets are needed, and how big is the last one?一条 10,000 字节的消息被拆成数据包,每个包最多携带 1,460 字节数据。需要多少个数据包?最后一个有多大?

10,000 ÷ 1,460 = 6.85, rounded up to 7 packets. Six full packets carry 6 × 1,460 = 8,760 bytes, so the last packet carries 10,000 − 8,760 = 1,240 bytes of data.

10,000 ÷ 1,460 = 6.85,向上取整为 7 个数据包。6 个满包携带 6 × 1,460 = 8,760 字节,所以最后一个包携带 10,000 − 8,760 = 1,240 字节数据。

One 1,500-byte packet crosses a link with latency 40 ms. Compare the total delay at 8 Mbps and at 80 Mbps. Does ten times the bandwidth give ten times faster delivery?一个 1,500 字节的数据包通过延迟为 40 ms 的链路。比较 8 Mbps 和 80 Mbps 时的总延迟。带宽增加十倍,送达速度会快十倍吗?

Sending time = 1,500 × 8 ÷ bandwidth: 1.5 ms at 8 Mbps and 0.15 ms at 80 Mbps. Total delay = 40 + 1.5 = 41.5 ms versus 40 + 0.15 = 40.15 ms. No: latency dominates for a small message, so the delivery time barely changes.

发送时间 = 1,500 × 8 ÷ 带宽:8 Mbps 时为 1.5 ms,80 Mbps 时为 0.15 ms。总延迟 = 40 + 1.5 = 41.5 ms 对 40 + 0.15 = 40.15 ms。不会:对小消息来说延迟占主导,所以送达时间几乎不变。

Packets 3, 1, 2 of a file arrive in that order, and packet 2 is damaged and dropped. What does the receiver do?一个文件的数据包按 3、1、2 的顺序到达,其中包 2 损坏并被丢弃。接收方怎么做?

It uses the sequence numbers to put the packets in order, notices that packet 2 is missing or unacknowledged, and the sender retransmits only packet 2. The other packets are not resent.

接收方用序列号给数据包排序,发现包 2 缺失或未被确认,发送方只重传包 2。其他数据包不用重发。

Why does the Internet break data into packets instead of sending one continuous stream?为什么互联网将数据拆分为数据包而不是发送一个连续流?
§2 · Q1
Because routers cannot handle large files因为路由器无法处理大文件
Packets can take different routes simultaneously, can be individually retransmitted if lost, and bandwidth is shared fairly数据包可以同时走不同路由,丢失后可单独重传,带宽可公平共享
Packets are encrypted automatically, which improves security数据包会自动加密,从而提高安全性
Packets are cheaper to transmit than streams数据包比流传输更便宜
Packet switching offers three key benefits: parallel routing (packets can travel different paths simultaneously), selective retransmission (only lost packets need to be resent), and fair bandwidth sharing. These make the Internet scalable and resilient.分组交换有三大优势:并行路由(数据包可同时走不同路径)、选择性重传(只需重传丢失的数据包)、带宽公平共享。这些特性使互联网具有可扩展性和弹性。
The reason for packets is parallel routing, selective retransmission, and fair sharing, not router limits, automatic encryption, or cost.使用数据包的原因是并行路由、选择性重传和公平共享,而非路由器限制、自动加密或成本。
Three packets from the same file arrive at a server in the order 3, 1, 2. How does the server reconstruct the original file?同一文件的三个数据包以 3、1、2 的顺序到达服务器。服务器如何重建原始文件?
§2 · Q2
Using the packet-number field in each packet's header to reorder them as 1, 2, 3使用每个数据包头部中的数据包编号字段将其重新排序为 1、2、3
It requests all three packets to be resent in the correct order它请求重新按正确顺序发送全部三个数据包
It uses the file size to guess the correct order它使用文件大小猜测正确顺序
It cannot reconstruct the file if packets arrive out of order如果数据包乱序到达,它无法重建文件
Each packet's header contains a sequence number. The receiving server buffers packets and uses sequence numbers to reassemble them in the correct order, regardless of arrival order. This is a core function of TCP.每个数据包的头部包含序列号。接收服务器缓冲数据包并使用序列号按正确顺序重新组装,无论到达顺序如何。这是 TCP 的核心功能。
Sequence numbers in the packet header enable reordering without resending all packets. The Internet is designed to handle out-of-order packet arrival.数据包头部的序列号使重新排序成为可能,无需重发所有数据包。互联网的设计能够处理乱序到达的数据包。

IP Addresses and DNSIP地址与域名系统

Learning objectives学习目标
  • State what an IP address is and what DNS does, and why both are needed.
  • Write an IPv4 address as four numbers from 0 to 255 (32 bits), spot an invalid one, and compute 232 and 2128.
  • Calculate the usable hosts in a subnet as 2h − 2 and choose the smallest prefix for a number of devices.
  • Trace a DNS lookup through the resolver, root, TLD and authoritative servers, and explain caching.
  • Distinguish public from private addresses and say what NAT does.
  • 说明什么是 IP 地址、DNS 的作用,以及为什么两者都需要。
  • 把 IPv4 地址写成四个 0 到 255 的数字(32 位),识别无效地址,并计算 232 和 2128。
  • 用 2h − 2 计算子网中可用的主机数,并为给定设备数选出最小的前缀。
  • 追踪经过解析器、根服务器、顶级域服务器和权威服务器的 DNS 查找,并解释缓存。
  • 区分公有地址与私有地址,并说明 NAT 的作用。
Two questions: where is the device? and what name does it go by?两个问题:设备在哪里?它叫什么名字?
  • IP addressIP地址: a unique numerical label assigned to every device on a network. IPv4: 32-bit, written as four 0–255 numbers separated by dots, e.g. 192.168.1.1. IPv6: 128-bit, written in hex with colons, e.g. 2001:0db8::1. CSTA 3A-NI-04 expects you to describe "addressing" as part of network scalability.:分配给网络上每台设备的唯一数字标签。IPv4:32 位,以点分隔四个 0–255 的数字,如 192.168.1.1。IPv6:128 位,以十六进制加冒号书写,如 2001:0db8::1。CSTA 3A-NI-04 要求你将"寻址"描述为网络可扩展性的一部分。
  • DNS (Domain Name System)域名系统(DNS): the Internet's "phone book." Translates human-readable domain names (e.g. google.com) into IP addresses (e.g. 142.250.80.46) that routers can forward packets to. Without DNS you would have to memorise IP addresses for every website.:互联网的"电话簿"。将人类可读的域名(如 google.com)翻译成路由器可以转发数据包的 IP 地址(如 142.250.80.46)。没有 DNS,你必须记住每个网站的 IP 地址。
  • Public vs private IP公有 IP 与私有 IP: private IP addresses (e.g. 192.168.x.x) are used inside a LAN and are not routable on the public Internet. Your router's public IP is the address the rest of the world sees. NAT (Network Address Translation) maps many private addresses to one public IP.:私有 IP 地址(如 192.168.x.x)在局域网内使用,不可在公共互联网上路由。你的路由器的公有 IP 是外部世界看到的地址。NAT(网络地址转换)将多个私有地址映射到一个公有 IP。
Worked Example 5: DNS lookup step by step例题 5:DNS 查找的逐步过程

What happens when you type www.example.com in your browser?当你在浏览器中输入 www.example.com 时会发生什么?

Browser                 DNS Resolver           Root DNS      .com DNS    example.com DNS
   |                        |                      |             |              |
   |--"www.example.com?"--->|                      |             |              |
   |                        |---"who is .com?"---->|             |              |
   |                        |<---"ask .com DNS"-----|             |              |
   |                        |---"who is example.com?"---------->|              |
   |                        |<---"ask example.com DNS"-----------|              |
   |                        |---"IP of www.example.com?"---------------------->|
   |                        |<---"93.184.216.34"-----------------------------  |
   |<---"93.184.216.34"-----|
   |
   |---TCP connection to 93.184.216.34:80/443 (HTTP/HTTPS)-----> Web Server

The DNS resolver caches the result so future lookups are instant. Your router or ISP typically acts as the DNS resolver. This hierarchical system allows the Internet's ~350 million domain names to be looked up without any single server knowing them all.DNS 解析器会缓存结果,使后续查找即时完成。你的路由器或 ISP 通常充当 DNS 解析器。这种层级系统使互联网约 3.5 亿个域名无需任何单一服务器全部知晓即可被查找。

Worked Example 6: Counting addresses and sizing a subnet例题 6:统计地址数量并确定子网大小

(a) How many addresses does IPv4 have, and how many does IPv6 have? (b) Is 192.168.1.300 a valid IPv4 address? (c) A classroom network must connect 100 devices. A subnet written as /p uses the first p bits for the network and leaves 32 − p bits for hosts. Which is the smallest block that fits, and how many addresses are spare?(a)IPv4 有多少个地址?IPv6 有多少个?(b)192.168.1.300 是有效的 IPv4 地址吗?(c)一个教室网络要连接 100 台设备。写作 /p 的子网用前 p 位表示网络,剩下 32 − p 位给主机。能容纳它们的最小地址块是哪个?还剩多少个地址?

(a) Totals. IPv4 has 32 bits, so 232 = 4,294,967,296 addresses (about 4.3 billion). IPv6 has 128 bits, so 2128 = 340,282,366,920,938,463,463,374,607,431,768,211,456, about 3.4 × 1038. IPv6 has 296 (about 7.9 × 1028) times as many.(a) 总数。IPv4 有 32 位,所以有 232 = 4,294,967,296 个地址(约 43 亿)。IPv6 有 128 位,所以有 2128 = 340,282,366,920,938,463,463,374,607,431,768,211,456 个,约 3.4 × 1038。IPv6 的地址数是 IPv4 的 296 倍(约 7.9 × 1028)。

(b) Validity. An IPv4 address is four numbers of 8 bits each (4 × 8 = 32 bits), so each number must be from 0 to 255. The last number, 300, is larger than 255, so 192.168.1.300 is not valid. For example 192.168.1.1 is 11000000.10101000.00000001.00000001 in binary.(b) 有效性。IPv4 地址由四个各占 8 位的数字组成(4 × 8 = 32 位),所以每个数字必须在 0 到 255 之间。最后一个数字 300 大于 255,所以 192.168.1.300 无效。例如 192.168.1.1 的二进制是 11000000.10101000.00000001.00000001。

(c) Subnet size. With h host bits there are 2h addresses, but the first (the network address) and the last (the broadcast address) are reserved, so usable hosts = 2h − 2. Try the options: /26 leaves 6 host bits, 26 − 2 = 62 hosts, too few. /25 leaves 7 host bits, 27 − 2 = 126 hosts, enough. So the smallest block is /25 (mask 255.255.255.128), with 126 − 100 = 26 spare addresses. A /24 (254 hosts) would also work but wastes 154.(c) 子网大小。有 h 个主机位时共有 2h 个地址,但第一个(网络地址)和最后一个(广播地址)被保留,所以可用主机数 = 2h − 2。逐个尝试:/26 留 6 个主机位,26 − 2 = 62 台,太少。/25 留 7 个主机位,27 − 2 = 126 台,够用。所以最小的块是 /25(掩码 255.255.255.128),剩余 126 − 100 = 26 个地址。/24(254 台)也可以,但会浪费 154 个。

import ipaddress

for prefix in (24, 25, 26):
    net = ipaddress.ip_network(f"192.168.1.0/{prefix}")
    hosts = net.num_addresses - 2
    print(f"/{prefix}", net.netmask, net.num_addresses, "addresses,", hosts, "usable hosts")

print(2 ** 32)
print(2 ** 128)
print(int(ipaddress.ip_address("192.168.1.1")))

# output:
# /24 255.255.255.0 256 addresses, 254 usable hosts
# /25 255.255.255.128 128 addresses, 126 usable hosts
# /26 255.255.255.192 64 addresses, 62 usable hosts
# 4294967296
# 340282366920938463463374607431768211456
# 3232235777

Why this works: each extra bit doubles the count, so address problems are powers of 2. Subtract 2 only for usable hosts in a subnet. The 192.168.x.x block is private: it works inside a LAN and is shared out through NAT.为什么这样做:每多一位,数量翻一倍,所以地址问题都是 2 的幂。只有计算子网内可用主机数时才减 2。192.168.x.x 属于私有地址段:只在局域网内使用,通过 NAT 共享出口。

Exam tip考试提示

For explain what DNS does, say precisely that it translates a domain name into an IP address; do not write that it "finds the website" or encrypts anything. For a calculate question on addresses, write 2n first and then the number, and say whether you want all addresses or usable hosts (2h − 2). Common errors: calling 256 a valid IPv4 number, mixing up an IP address with a domain name, and thinking private addresses can be reached directly from the Internet.

遇到解释 DNS 的作用时,要准确地说它把域名翻译成 IP 地址;不要写成“找到网站”,也不要说它加密。遇到地址的计算(calculate)题,先写 2n,再写数值,并说明要的是全部地址还是可用主机数(2h − 2)。常见错误:把 256 当成有效的 IPv4 数字,混淆 IP 地址与域名,以及以为私有地址可以从互联网直接访问。

Check your understanding自我检测
What does DNS do, and why can the Internet not simply use domain names to route packets?DNS 的作用是什么?为什么互联网不能直接用域名来路由数据包?

DNS translates a human-readable domain name such as example.com into an IP address. Routers forward packets by IP address, so a browser must look the name up first.

DNS 把 example.com 这样便于人读的域名翻译成 IP 地址。路由器按 IP 地址转发数据包,所以浏览器必须先查询域名。

Which of these are valid IPv4 addresses: 172.16.254.1, 10.0.0.256, 192.168.1, 8.8.8.8?下列哪些是有效的 IPv4 地址:172.16.254.1、10.0.0.256、192.168.1、8.8.8.8?

172.16.254.1 and 8.8.8.8 are valid. 10.0.0.256 is invalid because 256 is greater than 255. 192.168.1 is invalid because it has only three numbers instead of four.

172.16.254.1 和 8.8.8.8 有效。10.0.0.256 无效,因为 256 大于 255。192.168.1 无效,因为只有三个数字而不是四个。

How many usable hosts does a /27 subnet have? What is the smallest prefix that fits 50 devices?/27 子网有多少个可用主机?能容纳 50 台设备的最小前缀是什么?

/27 leaves 32 − 27 = 5 host bits: 25 − 2 = 30 usable hosts, too few for 50. /26 leaves 6 host bits: 26 − 2 = 62 usable hosts, enough. The smallest prefix that fits is /26.

/27 留 32 − 27 = 5 个主机位:25 − 2 = 30 台可用主机,容不下 50 台。/26 留 6 个主机位:26 − 2 = 62 台可用主机,够用。能容纳的最小前缀是 /26。

A resolver already has www.example.com in its cache. How does the next lookup differ from the first one?解析器的缓存里已经有 www.example.com。下一次查找与第一次有什么不同?

The resolver answers straight from its cache, so it skips the queries to the root, TLD and authoritative servers. The reply is faster, but it is only valid until the cached record expires.

解析器直接用缓存回答,跳过对根服务器、顶级域服务器和权威服务器的查询。回复更快,但只在缓存记录过期之前有效。

What is the primary function of DNS (Domain Name System)?域名系统(DNS)的主要功能是什么?
§3 · Q1
Encrypting data as it travels across the Internet在数据通过互联网传输时对其进行加密
Assigning unique IP addresses to each device on a LAN为局域网上的每台设备分配唯一 IP 地址
Translating human-readable domain names into IP addresses that routers can use将人类可读的域名翻译成路由器可使用的 IP 地址
Storing all web pages so they load faster存储所有网页使其加载更快
DNS translates domain names (like google.com) into IP addresses (like 142.250.80.46). Routers forward packets using IP addresses, not domain names; DNS bridges the human-friendly name and the machine-friendly address.DNS 将域名(如 google.com)翻译成 IP 地址(如 142.250.80.46)。路由器使用 IP 地址而非域名转发数据包,DNS 在人类友好的名称和机器友好的地址之间架起了桥梁。
DNS = domain-name to IP translation. Encryption is handled by TLS/HTTPS. IP assignment in a LAN is done by DHCP. Caching is a side effect, not the primary function.DNS = 域名到 IP 的翻译。加密由 TLS/HTTPS 处理。局域网内 IP 分配由 DHCP 完成。缓存是副作用,而非主要功能。
Why did the Internet move from IPv4 to IPv6?为什么互联网从 IPv4 迁移到 IPv6?
§3 · Q2
IPv6 is faster than IPv4 for routing packetsIPv6 在路由数据包时比 IPv4 更快
IPv4's 32-bit address space (~4 billion addresses) was nearly exhausted; IPv6's 128-bit space provides vastly more addressesIPv4 的 32 位地址空间(约 40 亿个地址)几近耗尽;IPv6 的 128 位空间提供了大得多的地址数量
IPv6 automatically encrypts all trafficIPv6 自动加密所有流量
IPv4 could not support wireless networksIPv4 不支持无线网络
IPv4 has 2³² ≈ 4.3 billion addresses. With billions of devices (smartphones, IoT sensors, servers), address space ran out. IPv6's 128 bits gives 2¹²⁸ ≈ 3.4×10³⁸ addresses; enough that every grain of sand on Earth (a common rough estimate is 7.5×10¹⁸ grains) could have about 4.5×10¹⁹ addresses of its own.IPv4 有 2³² ≈ 43 亿个地址。随着数十亿设备(智能手机、物联网传感器、服务器)的出现,地址空间耗尽。IPv6 的 128 位提供 2¹²⁸ ≈ 3.4×10³⁸ 个地址,足以让地球上每粒沙子(常见的粗略估计约为 7.5×10¹⁸ 粒)各拥有约 4.5×10¹⁹ 个地址。
The primary reason is address exhaustion; IPv4's ~4 billion addresses proved insufficient for the modern Internet. Speed and encryption are not the main drivers.主要原因是地址耗尽,IPv4 约 40 亿个地址对现代互联网而言不够用。速度和加密不是主要驱动因素。

Protocols: TCP/IP, HTTP, and HTTPS协议:TCP/IP、HTTP 与 HTTPS

Learning objectives学习目标
  • Define a protocol and state the job of IP, TCP, UDP, HTTP and HTTPS.
  • Describe the TCP three-way handshake (SYN, SYN-ACK, ACK).
  • Compare TCP and UDP and justify the choice for a scenario.
  • Match protocols to ports: HTTP 80, HTTPS 443, DNS 53.
  • Count the round trips before the first byte of a page arrives with HTTP and with HTTPS.
  • State what HTTPS adds to HTTP and what it does not protect.
  • 定义协议(protocol),并说明 IP、TCP、UDP、HTTP 和 HTTPS 各自的作用。
  • 描述 TCP 三次握手(SYN、SYN-ACK、ACK)。
  • 比较 TCP 与 UDP,并为某个场景的选择说明理由。
  • 把协议与端口对应起来:HTTP 80、HTTPS 443、DNS 53。
  • 计算使用 HTTP 与 HTTPS 时,页面第一个字节到达之前需要几个往返。
  • 说明 HTTPS 比 HTTP 多了什么,以及它不能保护什么。
A protocol is a set of rules that two parties agree to follow when communicating.协议(protocol)是通信双方同意遵守的一套规则。
  • IP (Internet Protocol)IP(互联网协议): responsible for addressing and routing. Puts the sender's and destination's IP addresses on each packet. Connectionless; does not guarantee delivery or order.:负责寻址和路由。在每个数据包上放置发送方和目标的 IP 地址。无连接,不保证送达或顺序。
  • TCP (Transmission Control Protocol)TCP(传输控制协议): adds reliability on top of IP. Establishes a connection (3-way handshake: SYN → SYN-ACK → ACK), numbers packets, requires acknowledgement (ACK) for each, retransmits lost packets, reorders out-of-sequence packets. Used for web pages, email, file transfer, anywhere accuracy matters. BC CIS 11 Content (verbatim): "four layers of the Transmission Control Protocol/Internet Protocol (TCP/IP).":在 IP 之上增加可靠性。建立连接(三次握手:SYN → SYN-ACK → ACK),对数据包编号,要求每个包的确认(ACK),重传丢失数据包,重新排序乱序数据包。用于网页、电子邮件、文件传输,任何需要准确性的场景。BC CIS 11 内容(原文):"TCP/IP 的四层。"
  • UDP (User Datagram Protocol)UDP(用户数据报协议): fast but unreliable; no handshake, no ACK, no retransmission. Used for video streaming and online gaming where speed beats accuracy (a dropped frame is better than a frozen screen).:快速但不可靠;无握手、无 ACK、无重传。用于视频流和在线游戏,这些场景中速度优先于准确性(丢帧比画面卡顿更好)。
  • HTTP / HTTPSHTTP / HTTPS: HTTP (HyperText Transfer Protocol) is the protocol browsers use to request and receive web pages. HTTPS = HTTP + TLS encryption; data is encrypted between browser and server. CSTA 3A-NI-07: "Compare various security measures, considering tradeoffs between the usability and security of a computing system.":HTTP(超文本传输协议)是浏览器用于请求和接收网页的协议。HTTPS = HTTP + TLS 加密;浏览器与服务器之间的数据被加密。CSTA 3A-NI-07:"比较各种安全措施,考虑计算系统可用性与安全性之间的权衡。"
Worked Example 7: Comparing TCP and UDP例题 7:比较 TCP 与 UDP

Which protocol to use depends on whether accuracy or speed matters more.选择哪种协议取决于准确性还是速度更重要。

Feature特性 TCPTCP UDPUDP
Connection连接3-way handshake before data数据传输前三次握手None (fire and forget)无(发送即忘)
Delivery guarantee送达保证Yes: ACK + retransmit是:ACK + 重传No否
Ordering排序Yes: reorders packets是:重新排序数据包No否
Speed速度Slower (overhead)较慢(开销大)Faster较快
Use cases使用场景HTTP/HTTPS, email, file transferHTTP/HTTPS、电子邮件、文件传输Video streaming, VoIP, online gaming视频流、VoIP、在线游戏

AP CSP Big Idea 4 (CSN) explains that the Internet is fault tolerant because redundant paths let packets reroute. TCP's retransmission handles the reliability layer; IP handles the routing layer. Classic HTTP (versions 1.1 and 2) is built on TCP, so those web page requests travel over a reliable TCP connection (HTTP/3 uses QUIC over UDP instead).AP CSP 大概念 4(CSN)说明:互联网因冗余路径让数据包可以改道而具有容错性。 TCP 的重传处理可靠性层;IP 处理路由层。经典的 HTTP(1.1 和 2 版)建立在 TCP 之上,因此这些网页请求通过可靠的 TCP 连接传输(HTTP/3 改用基于 UDP 的 QUIC)。

Worked Example 8: Choosing a transport protocol and counting round trips例题 8:选择传输协议并计算往返次数

The round-trip time (RTT) between a laptop and a server is 80 ms. (a) Choose TCP or UDP, with a reason, for: a PDF download, a live video call, a DNS lookup, and a bank login page. (b) How long before the first byte of a page arrives with plain HTTP, and with HTTPS using TLS 1.3 (one extra round trip) or TLS 1.2 (two extra)? Count only the handshakes and one request and response, and ignore DNS and server time.笔记本电脑和服务器之间的往返时间(RTT)是 80 ms。(a)为下列场景选择 TCP 或 UDP 并说明理由:下载 PDF、实时视频通话、DNS 查询、银行登录页面。(b)使用普通 HTTP,以及使用 TLS 1.3(多一个往返)或 TLS 1.2(多两个往返)的 HTTPS 时,页面的第一个字节要多久才到达?只计握手以及一次请求和响应,忽略 DNS 和服务器处理时间。

(a) Choices. PDF download: TCP, because every byte must arrive, complete and in order. Live video call: UDP, because a late frame is useless and waiting for a retransmission would freeze the call. DNS lookup: normally UDP (port 53), because the question and the answer are each small and the resolver can simply ask again if no reply comes; large replies can fall back to TCP. Bank login page: TCP with HTTPS on port 443, because the data must be complete and encrypted.(a) 选择。下载 PDF:TCP,因为每个字节都必须完整且按序到达。实时视频通话:UDP,因为迟到的画面没有用,等待重传会让通话卡住。DNS 查询:通常用 UDP(端口 53),因为问题和答案都很小,没有回复时解析器重新询问即可;回复较大时可改用 TCP。银行登录页面:TCP,并用 443 端口上的 HTTPS,因为数据必须完整且加密。

(b) Round trips. TCP handshake: SYN goes out and SYN-ACK comes back, which is 1 RTT; the final ACK travels together with the request. Then the HTTP request and response take 1 RTT. So plain HTTP needs 2 × 80 = 160 ms. TLS 1.3 adds one round trip: 3 × 80 = 240 ms. TLS 1.2 adds two: 4 × 80 = 320 ms. A UDP DNS query and answer is 1 RTT = 80 ms.(b) 往返次数。TCP 握手:发出 SYN,收到 SYN-ACK,共 1 个 RTT;最后的 ACK 与请求一起发送。随后 HTTP 请求和响应用 1 个 RTT。所以普通 HTTP 需要 2 × 80 = 160 ms。TLS 1.3 多 1 个往返:3 × 80 = 240 ms。TLS 1.2 多 2 个往返:4 × 80 = 320 ms。UDP 的 DNS 查询和应答是 1 个 RTT = 80 ms。

Case情形 Round trips往返次数 Time at RTT = 80 msRTT = 80 ms 时的时间
UDP DNS queryUDP 的 DNS 查询180 ms
TCP + HTTP (port 80)TCP + HTTP(80 端口)2160 ms
TCP + TLS 1.3 + HTTP (port 443)TCP + TLS 1.3 + HTTP(443 端口)3240 ms
TCP + TLS 1.2 + HTTP (port 443)TCP + TLS 1.2 + HTTP(443 端口)4320 ms

Why this works: TCP and TLS spend round trips to buy reliability and encryption before any page data moves. UDP spends none, which is why real-time traffic uses it. The numbers are a simplified count; real browsers reuse connections to avoid some of these round trips.为什么这样做:TCP 和 TLS 先花费往返次数来换取可靠性和加密,之后页面数据才开始传输。UDP 不花这些往返,所以实时流量使用它。这里的数字是简化计数;真实浏览器会复用连接,省去其中一些往返。

Exam tip考试提示

For compare questions, use a small table with the same rows for both protocols (connection, delivery guarantee, ordering, speed, use). For justify the choice, tie the reason to the scenario: "a late video frame is useless, so retransmitting it wastes time" is better than "UDP is faster". Common errors: saying UDP is simply bad because it is unreliable, saying HTTPS makes the server itself safe (it protects data in transit), and saying TCP encrypts data (TLS does).

遇到比较(compare)题,用一个小表格,两种协议用相同的行(连接、送达保证、排序、速度、用途)。遇到说明选择理由(justify)时,把理由和场景联系起来:“迟到的视频帧没有用,重传只会浪费时间”比“UDP 更快”好。常见错误:因为 UDP 不可靠就说它不好,说 HTTPS 让服务器本身变安全(它保护的是传输中的数据),以及说 TCP 会加密数据(加密的是 TLS)。

Check your understanding自我检测
What is a port, and why do HTTP and HTTPS use different ones?什么是端口?为什么 HTTP 和 HTTPS 使用不同的端口?

An IP address finds the machine; a port number says which program on that machine should receive the data. By convention HTTP uses port 80 and HTTPS uses port 443, so the server can tell plain and encrypted web traffic apart.

IP 地址找到那台机器;端口号说明该机器上哪个程序应接收数据。按惯例 HTTP 使用 80 端口,HTTPS 使用 443 端口,所以服务器能区分普通和加密的网页流量。

List the three steps of the TCP handshake in order and say what they achieve.按顺序列出 TCP 握手的三个步骤,并说明它们的作用。

SYN (client asks to connect), SYN-ACK (server agrees and acknowledges), ACK (client acknowledges). Both sides now know the other is reachable and have agreed starting sequence numbers, so delivery can be tracked and reordered.

SYN(客户端请求连接)、SYN-ACK(服务器同意并确认)、ACK(客户端确认)。双方现在都知道对方可达,并约定了起始序列号,因此可以跟踪送达和重新排序。

A multiplayer game sends each player's position 60 times a second. Should it use TCP or UDP? Explain.一个多人游戏每秒发送 60 次玩家位置。应该用 TCP 还是 UDP?请解释。

UDP. If one position update is lost, the next one arrives 1/60 s later and replaces it. With TCP, newer updates would wait behind the retransmission of the old one, making the game stutter.

UDP。如果丢了一次位置更新,1/60 秒后下一次更新就会到达并取代它。用 TCP 的话,较新的更新要排在旧更新的重传后面,游戏会卡顿。

Does HTTPS hide which server you are visiting from the network?HTTPS 会向网络隐藏你正在访问哪台服务器吗?

No. HTTPS encrypts the content of the conversation (pages, passwords, form data), but the network can still see the server's IP address and usually the domain name. Encryption in transit hides what is said, not who is talking.

不会。HTTPS 加密的是通信内容(页面、密码、表单数据),但网络仍然能看到服务器的 IP 地址,通常也能看到域名。传输加密隐藏的是说了什么,而不是谁在通信。

A video-calling app drops a few frames per second to maintain low latency. Which transport protocol is most likely being used, and why?一个视频通话应用为保持低延迟每秒丢弃几帧。最可能使用哪种传输协议,为什么?
§4 · Q1
UDP: because speed is prioritised over guaranteed delivery; a dropped frame is acceptableUDP:因为速度优先于送达保证;丢帧是可接受的
TCP: because all packets must arrive in orderTCP:因为所有数据包必须按序到达
HTTP: because it is a web-based applicationHTTP:因为这是一个基于 Web 的应用
IP only: no transport protocol is needed仅 IP:不需要传输协议
UDP is used for real-time audio/video because it is faster: no handshake, no waiting for retransmissions. A dropped frame appears as a brief glitch; waiting for a TCP retransmission would freeze the video for longer.UDP 用于实时音频/视频,因为它更快:无握手、无等待重传。丢帧表现为短暂卡顿;等待 TCP 重传会导致视频卡顿更长时间。
Real-time video/audio uses UDP for speed. TCP guarantees order and delivery but adds latency. HTTP is application-layer; IP alone has no reliability mechanism.实时视频/音频使用 UDP 以获取速度。TCP 保证顺序和送达但增加延迟。HTTP 是应用层;仅 IP 没有可靠性机制。
What does HTTPS add over plain HTTP?HTTPS 在 HTTP 基础上增加了什么?
§4 · Q2
Faster packet routing更快的数据包路由
Guaranteed packet delivery保证数据包送达
TLS encryption so data cannot be read by eavesdroppers in transitTLS 加密,使传输中的数据不被窃听者读取
A separate IP address for the server服务器的独立 IP 地址
HTTPS = HTTP + TLS (Transport Layer Security). TLS encrypts the data between browser and server so that anyone intercepting the packets (e.g. on a public Wi-Fi) sees only ciphertext, not your password or credit card number.HTTPS = HTTP + TLS(传输层安全)。TLS 加密浏览器与服务器之间的数据,使任何截获数据包的人(如在公共 Wi-Fi 上)只看到密文,而非你的密码或信用卡号。
HTTPS adds TLS encryption, not faster routing, not delivery guarantees (those come from TCP), and not a new IP address. The S stands for Secure.HTTPS 增加了 TLS 加密,而非更快路由、送达保证(那来自 TCP)或新 IP 地址。S 代表 Secure(安全)。

The Layered / OSI Model分层模型 / OSI 参考模型

Learning objectives学习目标
  • Name the seven OSI layers in order and give one protocol or device for each.
  • Map the four TCP/IP layers onto the OSI layers.
  • Explain encapsulation and decapsulation, and calculate the size of a message after each header is added.
  • Explain why layering helps: each layer has one job and can be replaced without changing the others.
  • Place a protocol or device (HTTP, TLS, TCP, IP, Ethernet, router, switch) at the correct layer.
  • 按顺序说出 OSI 七层,并各举一个协议或设备。
  • 把 TCP/IP 的四层对应到 OSI 的各层。
  • 解释封装与解封装,并计算每加一个头部后消息的大小。
  • 解释分层为什么有用:每层只做一件事,可以替换其中一层而不改变其他层。
  • 把协议或设备(HTTP、TLS、TCP、IP、以太网、路由器、交换机)放到正确的层。
Why layers? Each layer handles one job and talks only to the layers immediately above and below it.为什么分层?每层只做一件事,只与紧邻的上下层通信。
  • BC CIS 11 Content (verbatim): "seven layers of the Open System Interconnection (OSI) reference model; 'interoperability' in the functioning of the Internet; four layers of the Transmission Control Protocol/Internet Protocol (TCP/IP)."BC CIS 11 内容(原文):"OSI 参考模型的七层;互联网运作中的'互操作性';TCP/IP 的四层。"
  • Mnemonic for OSI layers 7→1: All People Seem To Need Data Processing (Application, Presentation, Session, Transport, Network, Data Link, Physical). Layer 7 is closest to the user; Layer 1 is the physical wire.OSI 七层(7→1)记忆口诀:应用、表示、会话、传输、网络、数据链路、物理。第 7 层最靠近用户;第 1 层是物理线路。
  • The TCP/IP model (4 layers) collapses OSI's 7 into: Application (= OSI 5+6+7), Transport (= OSI 4), Internet (= OSI 3), Network Access / Link (= OSI 1+2).TCP/IP 模型(4 层)将 OSI 7 层合并为:应用层(= OSI 5+6+7)、传输层(= OSI 4)、网络层 / 互联网层(= OSI 3)、网络接入层 / 链路层(= OSI 1+2)。
Worked Example 9: The OSI seven layers with examples例题 9:OSI 七层及示例

What each layer does, and which protocols/hardware live there.每层的功能,以及对应的协议/硬件。

Layer | Name              | Job                            | Examples
------+-------------------+--------------------------------+-------------------
  7   | Application       | User-facing services           | HTTP, HTTPS, DNS, FTP
  6   | Presentation      | Data format / encryption       | TLS/SSL, JPEG, MP3
  5   | Session           | Opening/closing sessions       | NetBIOS, RPC
  4   | Transport         | End-to-end delivery, ports     | TCP, UDP
  3   | Network           | Routing between networks       | IP, ICMP, routers
  2   | Data Link         | Frame delivery on one link     | Ethernet, Wi-Fi (802.11), MAC
  1   | Physical          | Bits on the wire / air         | Cables, fibre, radio waves

A helpful analogy: sending a letter by courier. Layer 7 = the letter's content (your message). Layer 4 = the tracking number and the flat number on the parcel (which program receives it, and confirming it arrived). Layer 3 = the street address and the postal sorting office (routing by postcode). Layer 1 = the van's wheels on the road (physical transport). Each layer adds a header when sending and strips it when receiving; the two steps are called encapsulation and decapsulation.一个有用的比喻:快递寄信。第 7 层 = 信的内容(你的消息)。第 4 层 = 包裹上的运单号和门牌号(哪个程序接收,并确认送达)。第 3 层 = 街道地址和邮件分拣中心(按邮政编码路由)。第 1 层 = 货车在路上的车轮(物理运输)。每层发送时添加头部信息,接收时去除,称为封装和解封装。

Worked Example 10: Adding headers layer by layer (encapsulation)例题 10:逐层添加头部(封装)

A browser sends a 500-byte HTTP request. TCP adds a 20-byte header, IP adds a 20-byte header, and Ethernet adds a 14-byte header and a 4-byte trailer (minimum sizes, no options). Find the size after each layer, the total overhead, and the overhead as a percentage of what goes on the wire.浏览器发送一个 500 字节的 HTTP 请求。TCP 增加 20 字节头部,IP 增加 20 字节头部,以太网增加 14 字节头部和 4 字节尾部(最小长度,不含选项)。求每一层之后的大小、总开销,以及开销占线路上传输量的百分比。

Step 1: Application layer. The HTTP request is the data: 500 bytes.第 1 步:应用层。HTTP 请求就是数据:500 字节。

Step 2: Transport layer (TCP). 500 + 20 = 520 bytes (a segment).第 2 步:传输层(TCP)。500 + 20 = 520 字节(报文段)。

Step 3: Internet layer (IP). 520 + 20 = 540 bytes (a packet).第 3 步:网络互联层(IP)。520 + 20 = 540 字节(数据包)。

Step 4: Link layer (Ethernet). 540 + 14 + 4 = 558 bytes (a frame), which is 558 × 8 = 4,464 bits on the wire.第 4 步:链路层(以太网)。540 + 14 + 4 = 558 字节(帧),即线路上传输 558 × 8 = 4,464 比特。

Overhead. 558 − 500 = 58 bytes, and 58 ÷ 558 = 10.4% of the frame. The receiver reverses the process (decapsulation): Ethernet removes its header and trailer, IP removes its header, TCP removes its header, and the 500-byte request reaches the web server program. A switch reads only the Ethernet header (layer 2); a router reads the IP header (layer 3). The code checks the sizes:开销。558 − 500 = 58 字节,58 ÷ 558 = 帧的 10.4%。接收方反向处理(解封装):以太网去掉头部和尾部,IP 去掉头部,TCP 去掉头部,500 字节的请求到达 Web 服务器程序。交换机只读以太网头部(第 2 层);路由器读 IP 头部(第 3 层)。代码验证这些大小:

data = 500          # bytes of HTTP request (application layer)
segment = data + 20   # + 20-byte TCP header
packet = segment + 20 # + 20-byte IP header
frame = packet + 14 + 4  # + 14-byte Ethernet header + 4-byte trailer

print("application data:", data)
print("after TCP:", segment)
print("after IP:", packet)
print("after Ethernet:", frame)
print("overhead:", frame - data, "bytes")
print("overhead share:", round((frame - data) / frame * 100, 1), "%")

# output:
# application data: 500
# after TCP: 520
# after IP: 540
# after Ethernet: 558
# overhead: 58 bytes
# overhead share: 10.4 %

Why this works: each layer wraps the one above and only reads its own header, which is why Wi-Fi can replace Ethernet without changing TCP or HTTP. Figure 1 shows the same sizes beside the layer stack.为什么这样做:每一层都把上一层包起来,只读取自己的头部,所以 Wi-Fi 可以取代以太网而不用改动 TCP 或 HTTP。图 1 把同样的大小标在分层结构旁边。

OSI modelOSI 模型 TCP/IP modelTCP/IP 模型 Examples示例协议 Size after layer经过该层后的大小 7 Application7 应用层 6 Presentation6 表示层 5 Session5 会话层 4 Transport4 传输层 3 Network3 网络层 2 Data Link2 数据链路层 1 Physical1 物理层 Application应用层 Transport传输层 Internet网络互联层 Link链路层 HTTP, HTTPS, DNSHTTP, HTTPS, DNS TCP, UDPTCP, UDP IP, ICMPIP, ICMP Ethernet, Wi-FiEthernet, Wi-Fi TLS sits at layer 6TLS 位于第 6 层 500 B500 字节 520 B (+20)520 字节(+20) 540 B (+20)540 字节(+20) 558 B (+18)558 字节(+18) +20 TCP header, +20 IP header, +18 Ethernet header and trailer+20 TCP 头部,+20 IP 头部,+18 以太网头部和尾部
Figure 1. The four TCP/IP layers beside the seven OSI layers: Application covers OSI 5 to 7, Transport is OSI 4, Internet is OSI 3, Link covers OSI 1 and 2. The right column follows Worked Example 10: a 500-byte HTTP request becomes 520 bytes after TCP, 540 after IP and 558 after Ethernet, so 58 bytes of the 558 are headers and trailer.图 1. 四层 TCP/IP 模型与七层 OSI 模型对照:应用层对应 OSI 第 5 到 7 层,传输层对应第 4 层,网络互联层对应第 3 层,链路层对应第 1 和第 2 层。右列对应例题 10:500 字节的 HTTP 请求经过 TCP 后为 520 字节,经过 IP 后为 540 字节,经过以太网后为 558 字节,其中 58 字节是头部和尾部。
Exam tip考试提示

For name the layers, write the number and the name together, in one direction (7 to 1 or 1 to 7), and add an example protocol; a small table is clearer than a paragraph. For place a protocol, decide by its job: routing by IP address is layer 3, end-to-end delivery and ports are layer 4. Common errors: putting HTTP at the transport layer, saying the TCP/IP model has seven layers, reversing the order of the layers, and forgetting that a switch works at layer 2 while a router works at layer 3. This guide places TLS at OSI layer 6; some books place it between layers 4 and 7, so name the layer you are using.

遇到说出各层(name)时,把编号和名称写在一起,按同一个方向(7 到 1 或 1 到 7)写,并加上示例协议;小表格比一段文字更清楚。遇到放置协议时,按它的作用判断:按 IP 地址路由是第 3 层,端到端传输和端口属于第 4 层。常见错误:把 HTTP 放在传输层,说 TCP/IP 模型有七层,把层的顺序写反,以及忘了交换机工作在第 2 层而路由器工作在第 3 层。本指南把 TLS 放在 OSI 第 6 层;有些书把它放在第 4 层和第 7 层之间,所以要说明你采用的是哪一层。

Check your understanding自我检测
At which OSI layer does a router work, and which address does it read? What about a switch?路由器工作在 OSI 的哪一层?它读取哪种地址?交换机呢?

A router works at layer 3 (Network) and reads the destination IP address. A switch works at layer 2 (Data Link) and forwards frames by their MAC address.

路由器工作在第 3 层(网络层),读取目标 IP 地址。交换机工作在第 2 层(数据链路层),按 MAC 地址转发帧。

An application sends a 1,000-byte message. TCP adds 20 bytes, IP adds 20 bytes, and Ethernet adds 14 + 4 bytes. How big is the frame?一个应用发送 1,000 字节的消息。TCP 增加 20 字节,IP 增加 20 字节,以太网增加 14 + 4 字节。帧有多大?

1,000 + 20 = 1,020 after TCP; 1,020 + 20 = 1,040 after IP; 1,040 + 14 + 4 = 1,058 bytes after Ethernet. The overhead is 58 bytes.

TCP 之后 1,000 + 20 = 1,020;IP 之后 1,020 + 20 = 1,040;以太网之后 1,040 + 14 + 4 = 1,058 字节。开销是 58 字节。

Which TCP/IP layer replaces OSI layers 5, 6 and 7, and why is layering useful?TCP/IP 的哪一层取代了 OSI 的第 5、6、7 层?分层为什么有用?

The Application layer. Layering is useful because each layer does one job and talks only to the layers next to it, so one layer (for example Wi-Fi instead of Ethernet) can change without rewriting the others.

应用层。分层有用,因为每一层只做一件事,只与相邻的层通信,所以可以更换其中一层(例如用 Wi-Fi 代替以太网)而不用重写其他层。

Give the OSI layer number for DNS, TCP, IP, Wi-Fi and TLS (use this guide's table).写出 DNS、TCP、IP、Wi-Fi 和 TLS 所在的 OSI 层号(按本指南的表格)。

DNS: layer 7 (Application). TCP: layer 4 (Transport). IP: layer 3 (Network). Wi-Fi: layer 2 (Data Link). TLS: layer 6 (Presentation).

DNS:第 7 层(应用层)。TCP:第 4 层(传输层)。IP:第 3 层(网络层)。Wi-Fi:第 2 层(数据链路层)。TLS:第 6 层(表示层)。

At which OSI layer does IP (Internet Protocol) operate?IP(互联网协议)在哪个 OSI 层运行?
§5 · Q1
Layer 1: Physical第 1 层:物理层
Layer 4: Transport第 4 层:传输层
Layer 7: Application第 7 层:应用层
Layer 3: Network第 3 层:网络层
IP operates at Layer 3 (Network layer). It handles addressing (IP addresses) and routing packets between different networks. TCP/UDP operate at Layer 4 (Transport); HTTP operates at Layer 7 (Application).IP 在第 3 层(网络层)运行。它处理寻址(IP 地址)和在不同网络间路由数据包。TCP/UDP 在第 4 层(传输层)运行;HTTP 在第 7 层(应用层)运行。
Layer 3 = Network = IP (routing). Layer 4 = Transport = TCP/UDP. Layer 7 = Application = HTTP/DNS. Layer 1 = Physical = cables/radio waves.第 3 层 = 网络层 = IP(路由)。第 4 层 = 传输层 = TCP/UDP。第 7 层 = 应用层 = HTTP/DNS。第 1 层 = 物理层 = 电缆/无线电波。
The TCP/IP model has four layers. Which OSI layers does the TCP/IP "Application" layer correspond to?TCP/IP 模型有四层。TCP/IP 的"应用层"对应哪些 OSI 层?
§5 · Q2
OSI layers 5, 6, and 7 (Session, Presentation, Application)OSI 第 5、6、7 层(会话层、表示层、应用层)
OSI layers 1 and 2 (Physical and Data Link)OSI 第 1、2 层(物理层、数据链路层)
OSI layer 4 only (Transport)仅 OSI 第 4 层(传输层)
OSI layer 3 only (Network)仅 OSI 第 3 层(网络层)
The TCP/IP Application layer collapses OSI's Session (5), Presentation (6), and Application (7) into one layer. This simplification is why TCP/IP has 4 layers rather than 7.TCP/IP 应用层将 OSI 的会话层(5)、表示层(6)和应用层(7)合并为一层。这种简化是 TCP/IP 只有 4 层而非 7 层的原因。
TCP/IP Application = OSI 5+6+7. TCP/IP Transport = OSI 4. TCP/IP Internet = OSI 3. TCP/IP Link = OSI 1+2.TCP/IP 应用层 = OSI 5+6+7。TCP/IP 传输层 = OSI 4。TCP/IP 网络层 = OSI 3。TCP/IP 链路层 = OSI 1+2。
Going deeper: interoperability and open standards BC CIS 11/12深入:互操作性与开放标准 BC CIS 11/12

BC CIS 11 Content names "International Organization for Standardization (ISO) in the creation of open standards for networking" and "'interoperability' in the functioning of the Internet." The OSI model is an ISO standard (ISO/IEC 7498-1). Interoperability means that a Mac, a Windows PC, and an Android phone can all send data to each other because they all implement the same open standards at each layer. Without open standards, every manufacturer would use proprietary protocols and devices from different vendors would be unable to communicate; similar to how locked-down app ecosystems restrict cross-platform data sharing. Open standards at the network layer are why the Internet is global rather than a patchwork of incompatible corporate networks.BC CIS 11 内容提到"ISO 在创建网络开放标准方面的作用"和"互联网运作中的'互操作性'"。OSI 模型是 ISO 标准(ISO/IEC 7498-1)。互操作性意味着 Mac、Windows PC 和 Android 手机都可以相互发送数据,因为它们在每一层都实现了相同的开放标准。没有开放标准,每个制造商都会使用专有协议,不同厂商的设备将无法通信,类似于封闭的应用生态系统如何限制跨平台数据共享。网络层的开放标准是互联网成为全球性而非一堆不兼容企业网络的原因。


Network Security Basics网络安全基础

Learning objectives学习目标
  • Explain what a firewall does and trace packets through an ordered rule list (first match wins, default block).
  • Distinguish a virus, a worm, a Trojan, ransomware and spyware.
  • Explain encryption in transit and say what it does not protect against.
  • Recommend a defence for a threat and state its tradeoff.
  • Explain why multi-factor authentication improves security but reduces convenience.
  • 解释防火墙的作用,并让数据包依次通过有序规则列表(首个匹配生效,默认拦截)。
  • 区分病毒、蠕虫、木马、勒索软件和间谍软件。
  • 解释传输加密,并说明它不能防范什么。
  • 针对某个威胁推荐防御措施,并说明其权衡。
  • 解释多因素认证为什么提高安全性却降低便利性。
Three questions: who can enter? is the data readable? is the device clean?三个问题:谁可以进入?数据可读吗?设备干净吗?
  • Firewall防火墙: a hardware or software system that monitors and controls incoming and outgoing network traffic based on rules. It blocks unauthorised connections while allowing legitimate traffic. CSTA 3A-NI-06: "Recommend security measures to address various scenarios.":根据规则监控和控制进出网络流量的硬件或软件系统。它阻止未授权连接,同时允许合法流量。CSTA 3A-NI-06:"推荐安全措施以应对各种场景。"
  • Encryption in transit传输加密: data is scrambled using a key so that anyone intercepting the packets sees only ciphertext. TLS (used by HTTPS) is the standard. CSTA 3A-NI-07: "Compare various security measures, considering tradeoffs between the usability and security of a computing system.":使用密钥对数据进行加密,使截获数据包的任何人只看到密文。TLS(HTTPS 使用)是标准做法。CSTA 3A-NI-07:"比较各种安全措施,考虑可用性与安全性之间的权衡。"
  • Malware恶意软件: software designed to disrupt, damage, or gain unauthorised access. Types: virus (attaches to files), worm (self-replicates across the network without a host file), Trojan (disguised as legitimate software), ransomware (encrypts your files and demands payment), spyware (secretly monitors you). Ontario ICS3U C2.2 (verbatim): "describe procedures to safeguard data and programs from malware (e.g., viruses, Trojan horses, worms, spyware, adware, malevolent macros).":旨在破坏、损害或获取未授权访问的软件。类型:病毒(附着于文件)、蠕虫(无需宿主文件自行在网络中复制)、木马(伪装成合法软件)、勒索软件(加密你的文件并索要赎金)、间谍软件(秘密监视你)。安大略 ICS3U C2.2(原文):"描述保护数据和程序免受恶意软件(如病毒、木马、蠕虫、间谍软件、广告软件、恶意宏)侵害的程序。"
  • Key security tradeoff关键安全权衡: stronger security often reduces usability (e.g., multi-factor authentication is more secure but slower). CSTA 3A-NI-08: "Explain tradeoffs when selecting and implementing cybersecurity recommendations.":更强的安全性通常降低可用性(如多因素认证更安全但更慢)。CSTA 3A-NI-08:"解释选择和实施网络安全建议时的权衡。"
Worked Example 11: A system protection plan例题 11:系统保护计划

Ontario ICS3U C2.2 asks students to "devise a thorough system protection plan." Here is a layered defence for a school network.安大略 ICS3U C2.2 要求学生"制定全面的系统保护计划"。以下是学校网络的分层防护方案。

Threat威胁 Defence measure防御措施 Tradeoff权衡
Unauthorised external access未授权外部访问Firewall: block all non-whitelisted ports防火墙:封锁所有非白名单端口May block legitimate services; needs configuration可能阻止合法服务;需要配置
Password theft on shared Wi-Fi在共享 Wi-Fi 上的密码窃取HTTPS / TLS encryption in transitHTTPS / TLS 传输加密Slight performance overhead轻微性能开销
Virus / worm infection病毒 / 蠕虫感染Anti-malware software + patch management反恶意软件 + 补丁管理Ongoing cost; may slow system during scans持续成本;扫描时可能降低系统速度
Account compromise账户泄露Multi-factor authentication (MFA)多因素认证(MFA)Extra step for users; less convenient用户需多一步;便利性降低
Data loss from ransomware勒索软件导致的数据丢失Regular offline backups定期离线备份Storage cost; recovery takes time存储成本;恢复需要时间

CSTA 3A-NI-05: "Give examples to illustrate how sensitive data can be affected by malware and other attacks." The table above maps each attack vector to a concrete defence, satisfying CSTA 3A-NI-06 (recommend measures) and 3A-NI-08 (explain tradeoffs).CSTA 3A-NI-05:"举例说明敏感数据如何受到恶意软件和其他攻击的影响。"上表将每种攻击向量映射到具体防御措施,满足 CSTA 3A-NI-06(推荐措施)和 3A-NI-08(解释权衡)。

Worked Example 12: Tracing packets through firewall rules例题 12:让数据包依次通过防火墙规则

A school firewall checks its rules from top to bottom and the first matching rule decides. Rule 1: allow TCP port 443. Rule 2: allow TCP port 80. Rule 3: allow UDP port 53. Rule 4: block everything else. Decide what happens to five packets: TCP 443, TCP 22, UDP 53, UDP 443 and TCP 80. Then explain what would change if Rule 4 were moved to the top.学校防火墙从上到下检查规则,第一条匹配的规则生效。规则 1:允许 TCP 443 端口。规则 2:允许 TCP 80 端口。规则 3:允许 UDP 53 端口。规则 4:拦截其他所有流量。判断五个数据包的结果:TCP 443、TCP 22、UDP 53、UDP 443 和 TCP 80。然后说明如果把规则 4 移到最上面会发生什么。

Packet数据包 First matching rule首个匹配的规则 Result结果
TCP 443Rule 1规则 1Allow允许
TCP 22Rule 4 (rules 1 to 3 do not match)规则 4(规则 1 到 3 不匹配)Block拦截
UDP 53Rule 3规则 3Allow允许
UDP 443Rule 4 (rule 1 needs TCP, not UDP)规则 4(规则 1 要求 TCP,而不是 UDP)Block拦截
TCP 80Rule 2规则 2Allow允许

The same logic as code (the ANY rule matches any protocol and any port):同样的逻辑写成代码(ANY 规则匹配任何协议和任何端口):

# Rules are checked top to bottom; the first match decides. No match means block.
RULES = [
    ("allow", "TCP", 443),
    ("allow", "TCP", 80),
    ("allow", "UDP", 53),
    ("block", "ANY", None),
]

def decide(protocol, port):
    for action, rule_proto, rule_port in RULES:
        proto_ok = rule_proto in ("ANY", protocol)
        port_ok = rule_port is None or rule_port == port
        if proto_ok and port_ok:
            return action
    return "block"

packets = [("TCP", 443), ("TCP", 22), ("UDP", 53), ("UDP", 443), ("TCP", 80)]
for protocol, port in packets:
    print(protocol, port, "->", decide(protocol, port))

# output:
# TCP 443 -> allow
# TCP 22 -> block
# UDP 53 -> allow
# UDP 443 -> block
# TCP 80 -> allow

Rule order matters. If "block everything" were Rule 1, every packet would match it first, so all 5 would be blocked and the school would have no web or DNS access. Tradeoff: a default-block firewall is safer because anything not listed is refused, but TCP 22 (remote login) stops working until someone adds a rule for it. A firewall also cannot stop a Trojan that a user downloads over an allowed port such as 443, so it is one layer of a plan, not the whole plan.规则顺序很重要。如果“拦截所有”是规则 1,每个数据包都会先匹配它,5 个包全部被拦截,学校就上不了网,也无法使用 DNS。权衡:默认拦截的防火墙更安全,因为没有列出的流量一律拒绝,但 TCP 22(远程登录)在有人为它添加规则之前无法使用。防火墙也无法阻止用户通过 443 这样的放行端口下载木马,所以它只是保护计划中的一层,而不是全部。

Why this works: a firewall is an ordered list of conditions, so tracing it is the same as stepping through an if / elif chain.为什么这样做:防火墙就是一个有序的条件列表,所以追踪它就像逐步执行 if / elif 链。

Exam tip考试提示

For recommend and justify questions, write three parts: the threat, the measure, and the tradeoff (for example "offline backups: they restore files after ransomware, but cost storage and take time to restore"). Name the malware type exactly: a worm spreads by itself, a Trojan is disguised, ransomware demands payment. Common errors: saying a firewall encrypts data, saying HTTPS protects you from malware on your own device, saying MFA makes an account unhackable, and forgetting that firewall rule order matters.

遇到推荐(recommend)和说明理由(justify)的题目,写出三个部分:威胁、措施和权衡(例如“离线备份:能在勒索软件之后恢复文件,但占用存储空间,恢复也需要时间”)。恶意软件类型要说准:蠕虫自己传播,木马伪装自己,勒索软件索要赎金。常见错误:说防火墙会加密数据,说 HTTPS 能保护你免受自己设备上的恶意软件侵害,说 MFA 让账户无法被攻破,以及忘了防火墙规则的顺序很重要。

Check your understanding自我检测
Name the malware: (a) a free game that secretly installs a program, (b) a program that copies itself to other computers across the network with no host file, (c) a program that locks your files and demands payment.说出下列恶意软件的名称:(a)免费游戏,却悄悄安装了另一个程序;(b)无需宿主文件,自己通过网络复制到其他计算机;(c)锁住你的文件并索要赎金。

(a) Trojan. (b) Worm. (c) Ransomware.

(a)木马。(b)蠕虫。(c)勒索软件。

A page loads over HTTPS. Does that prove the site is trustworthy and safe to download from?一个页面通过 HTTPS 加载。这能证明该网站可信、下载是安全的吗?

No. HTTPS encrypts the data in transit so eavesdroppers cannot read it, but it does not check what the site does. A harmful site can also use HTTPS, so a Trojan can still arrive over an encrypted connection.

不能。HTTPS 加密传输中的数据,窃听者无法读取,但它不检查网站做了什么。有害网站也可以使用 HTTPS,所以木马仍可能通过加密连接到达。

Recommend one measure against ransomware on a school network and state its tradeoff.针对学校网络上的勒索软件推荐一项措施,并说明其权衡。

Regular offline backups: after an attack the files can be restored without paying. Tradeoff: storage cost, and restoring takes time, so recent work since the last backup can be lost. Keeping software patched is a second measure that costs staff time.

定期离线备份:遭到攻击后无需付赎金即可恢复文件。权衡:存储成本,而且恢复需要时间,上次备份之后的新工作可能丢失。保持软件及时打补丁是第二项措施,需要付出维护人员的时间。

Using the firewall from Worked Example 12, how many of the 5 packets are allowed? How many if "block everything" is moved to the top?使用例题 12 中的防火墙,5 个数据包中有几个被允许?如果把“拦截所有”移到最上面,有几个被允许?

3 are allowed (TCP 443, UDP 53, TCP 80). With "block everything" first, every packet matches it first, so 0 are allowed.

3 个被允许(TCP 443、UDP 53、TCP 80)。如果“拦截所有”排在第一位,每个包都先匹配它,所以 0 个被允许。

Which type of malware self-replicates across a network without needing to attach to a host file?哪种恶意软件无需附着于宿主文件即可在网络中自我复制?
§6 · Q1
Virus病毒
Worm蠕虫
Trojan木马
Spyware间谍软件
A worm self-replicates and spreads across the network on its own; no host file needed. Ontario ICS3U C2.2 lists worms among the malware types students must know. A virus needs to attach to a file; a Trojan disguises itself as legitimate software; spyware secretly monitors the user.蠕虫自我复制并独立在网络中传播,无需宿主文件。安大略 ICS3U C2.2 将蠕虫列为学生必须了解的恶意软件类型之一。病毒需要附着于文件;木马伪装成合法软件;间谍软件秘密监视用户。
Worm = self-replicates across network without a host file. Virus = attaches to files. Trojan = disguised as legitimate software. Spyware = secretly monitors.蠕虫 = 无需宿主文件在网络中自我复制。病毒 = 附着于文件。木马 = 伪装成合法软件。间谍软件 = 秘密监视。
A school IT department is deciding whether to require multi-factor authentication (MFA) for all students. Which statement best describes the security tradeoff?学校 IT 部门正在决定是否要求所有学生使用多因素认证(MFA)。哪项陈述最能描述安全权衡?
§6 · Q2
MFA makes the network faster because it uses a second layerMFA 因使用第二层而使网络更快
MFA eliminates all security threatsMFA 消除所有安全威胁
MFA reduces security because it adds complexityMFA 因增加复杂性而降低安全性
MFA increases security (harder to compromise) but reduces usability (extra step per login)MFA 提高安全性(更难被攻破)但降低可用性(每次登录需额外步骤)
MFA requires a second proof of identity (e.g. a one-time code texted to your phone) making account compromise much harder; but every login takes an extra step. CSTA 3A-NI-07 asks you to compare security measures "considering tradeoffs between the usability and security of a computing system."MFA 要求第二种身份证明(如发送到手机的一次性验证码),使账户泄露更难,但每次登录需要额外步骤。CSTA 3A-NI-07 要求你比较安全措施,"考虑计算系统可用性与安全性之间的权衡"。
MFA improves security but reduces convenience; classic security-usability tradeoff. It does not eliminate all threats (phishing, physical theft) and has nothing to do with network speed.MFA 提高安全性但降低便利性,经典的安全性与可用性权衡。它不能消除所有威胁(网络钓鱼、物理盗窃),也与网络速度无关。

The Web vs. the Internet万维网与互联网的区别

Learning objectives学习目标
  • Distinguish the Internet from the Web, with examples of Internet services that are not the Web.
  • Describe the client-server model: a client sends a request and the server sends a response.
  • Split a URL into scheme, host, port, path, query and fragment.
  • State the default ports (HTTP 80, HTTPS 443) and what a status code such as 200 or 404 tells you.
  • Put the steps of loading a web page in order: DNS, TCP, TLS, HTTP.
  • 区分互联网与万维网,并举出不属于万维网的互联网服务。
  • 描述客户端-服务器模型:客户端发送请求,服务器发回响应。
  • 把 URL 拆成协议、主机、端口、路径、查询和片段。
  • 说出默认端口(HTTP 80、HTTPS 443),以及 200、404 这样的状态码表示什么。
  • 按顺序排出加载网页的步骤:DNS、TCP、TLS、HTTP。
The Internet ≠ the Web. The Internet is the infrastructure; the Web is one service running on it.互联网 ≠ 万维网。互联网是基础设施;万维网是运行在它之上的一种服务。
  • The Internet互联网: a global network of networks that uses the TCP/IP protocol suite to route packets. It carries many services: the Web, email (SMTP), file transfer (FTP), video calls (VoIP), online gaming, IoT devices.:使用 TCP/IP 协议套件路由数据包的全球网络的网络。它承载多种服务:万维网、电子邮件(SMTP)、文件传输(FTP)、视频通话(VoIP)、在线游戏、物联网设备。
  • The World Wide Web万维网: a system of interlinked hypertext documents (web pages) accessed via HTTP/HTTPS. Invented by Tim Berners-Lee in 1989 as one application running over the Internet. Uses URLs to identify resources, HTML to structure pages, and HTTP to transfer them.:通过 HTTP/HTTPS 访问的相互链接的超文本文档(网页)系统。由 Tim Berners-Lee 于 1989 年发明,作为运行在互联网上的一种应用。使用 URL 标识资源,HTML 构建页面,HTTP 传输它们。
  • Client-server model客户端-服务器模型: a client (e.g. your browser) sends a request to a server (e.g. a web server). The server processes the request and sends back a response (e.g. an HTML page). AB CSE1210 and CSE1220 introduce "Internet computing through the use of … Web-specific markup languages"; that is the client-server Web model.:客户端(如你的浏览器)向服务器(如 Web 服务器)发送请求。服务器处理请求并返回响应(如 HTML 页面)。AB CSE1210 和 CSE1220 通过"Web 专用标记语言"介绍"互联网计算",即客户端-服务器 Web 模型。
  • URL anatomyURL 解析: in https://www.example.com:443/path?q=1#section, https = protocol, www.example.com = domain name (DNS resolves to IP), 443 = port (default for HTTPS), /path = resource path on the server, ?q=1 = query string, #section = fragment (in-page anchor).:在 https://www.example.com:443/path?q=1#section 中,https = 协议,www.example.com = 域名(DNS 解析为 IP),443 = 端口(HTTPS 默认端口),/path = 服务器上的资源路径,?q=1 = 查询字符串,#section = 片段(页内锚点)。
Worked Example 13: A browser loading a web page例题 13:浏览器加载网页

From typing a URL to seeing the page; every layer is involved.从输入 URL 到看到页面,每一层都参与其中。

You type: https://www.example.com/index.html

Step 1  DNS lookup: "www.example.com" -> 93.184.216.34
Step 2  TCP 3-way handshake:  Browser --SYN-->  Server
                              Browser <-SYN-ACK- Server
                              Browser --ACK-->   Server
Step 3  TLS handshake: exchange certificates, agree on encryption key
Step 4  HTTP request (encrypted):
        GET /index.html HTTP/1.1
        Host: www.example.com
Step 5  HTTP response (encrypted):
        HTTP/1.1 200 OK
        Content-Type: text/html
        [HTML body]
Step 6  Browser parses HTML, requests CSS/JS/images (repeat steps 4-5)
Step 7  Browser renders page on screen

Notice: DNS (Layer 7, Application) resolves the name. TCP (Layer 4, Transport) guarantees delivery. TLS (Layer 6, Presentation in OSI terms) encrypts. IP (Layer 3, Network) routes. Ethernet/Wi-Fi (Layer 2, Data Link) delivers the frame on the local link. Every OSI layer contributes to one page load.注意:DNS(第 7 层,应用层)解析名称。TCP(第 4 层,传输层)保证送达。TLS(OSI 第 6 层,表示层)加密。IP(第 3 层,网络层)路由。以太网/Wi-Fi(第 2 层,数据链路层)在本地链路上传送帧。每个 OSI 层都参与一次页面加载。

Worked Example 14: Splitting a URL with code例题 14:用代码拆分 URL

Label the parts of https://www.example.com:8443/path/page.html?q=networks&page=2#top. Which port would the browser use if :8443 were left out? Then confirm the parts with Python.标出 https://www.example.com:8443/path/page.html?q=networks&page=2#top 的各个部分。如果去掉 :8443,浏览器会使用哪个端口?然后用 Python 验证各部分。

Part部分 Value取值 Meaning含义
Scheme协议httpsHTTP with TLS encryption带 TLS 加密的 HTTP
Host主机www.example.comThe domain name that DNS turns into an IP address由 DNS 转换成 IP 地址的域名
Port端口8443Which program on the server to contact (default for https is 443)要联系服务器上的哪个程序(https 的默认端口是 443)
Path路径/path/page.htmlThe resource on the server服务器上的资源
Query查询q=networks&page=2Name=value pairs sent to the server发送给服务器的 名称=值 对
Fragment片段topA place inside the page; the browser uses it and does not send it to the server页面内的位置;由浏览器使用,不会发送给服务器
from urllib.parse import urlparse, parse_qs

url = "https://www.example.com:8443/path/page.html?q=networks&page=2#top"
parts = urlparse(url)

print("scheme:", parts.scheme)
print("host:", parts.hostname)
print("port:", parts.port)
print("path:", parts.path)
print("query:", parse_qs(parts.query))
print("fragment:", parts.fragment)

plain = urlparse("https://school.ca/grades?term=1")
print("port given:", plain.port)

# output:
# scheme: https
# host: www.example.com
# port: 8443
# path: /path/page.html
# query: {'q': ['networks'], 'page': ['2']}
# fragment: top
# port given: None

Default port. With :8443 left out, the URL does not name a port (Python prints None), and the browser uses the default for the scheme: 443 for https and 80 for http. parse_qs returns each value inside a list because a name can appear more than once.默认端口。去掉 :8443 后,URL 没有指明端口(Python 输出 None),浏览器使用该协议的默认端口:https 为 443,http 为 80。parse_qs 把每个值放在列表里,因为同一个名称可以出现多次。

Why this works: a URL is a structured address, where the scheme picks the protocol, the host is looked up by DNS, the port picks the program, and the path picks the resource.为什么这样做:URL 是结构化的地址,其中协议决定使用哪种协议,主机由 DNS 查询,端口决定联系哪个程序,路径决定要哪个资源。

Exam tip考试提示

For distinguish the Internet from the Web, give a one-line definition of each plus an example of an Internet service that is not the Web (email, file transfer, an online game): the Internet is the infrastructure, the Web is one service on it. For URL questions, name every part you label. Common errors: saying the Web and the Internet are the same thing, saying http:// pages are encrypted, saying the fragment is sent to the server, and treating a 404 response as a network failure.

遇到区分互联网与万维网时,各用一句话下定义,再给出一个不属于万维网的互联网服务(电子邮件、文件传输、在线游戏):互联网是基础设施,万维网是其上的一种服务。遇到 URL 题,要为你标出的每个部分命名。常见错误:说万维网和互联网是同一回事,说 http:// 页面是加密的,说片段会发送给服务器,以及把 404 响应当作网络故障。

Check your understanding自我检测
Which of these are the Web, and which are Internet services that are not the Web: email, a school web page, an online game, file transfer (FTP)?下列哪些属于万维网,哪些是不属于万维网的互联网服务:电子邮件、学校网页、在线游戏、文件传输(FTP)?

The school web page is the Web (HTTP/HTTPS). Email, the online game and FTP are Internet services that are not the Web; they use their own protocols over the same Internet.

学校网页属于万维网(HTTP/HTTPS)。电子邮件、在线游戏和 FTP 是不属于万维网的互联网服务;它们在同一个互联网上使用各自的协议。

Label the parts of http://school.ca/grades?term=1&sort=name#top and give the default port.标出 http://school.ca/grades?term=1&sort=name#top 的各个部分,并给出默认端口。

Scheme: http. Host: school.ca. Path: /grades. Query: term=1&sort=name. Fragment: top. No port is written, so the browser uses the default for http, which is 80.

协议:http。主机:school.ca。路径:/grades。查询:term=1&sort=name。片段:top。没有写端口,所以浏览器使用 http 的默认端口 80。

A browser shows "404 Not Found". Did the network fail?浏览器显示“404 Not Found”。是网络出了故障吗?

No. The network worked: the request reached the server and the server answered. The answer says the requested path does not exist on the server. A status of 200 OK would mean the request succeeded.

不是。网络是正常的:请求到达了服务器,服务器也作了回应。回应说明请求的路径在服务器上不存在。状态码 200 OK 才表示请求成功。

Put these in order when you open https://school.ca: HTTP request, TLS handshake, DNS lookup, TCP handshake.打开 https://school.ca 时,把下列步骤排序:HTTP 请求、TLS 握手、DNS 查找、TCP 握手。

1. DNS lookup (find the IP address). 2. TCP handshake (open the connection). 3. TLS handshake (agree on encryption). 4. HTTP request (ask for the page, encrypted).

1. DNS 查找(找到 IP 地址)。2. TCP 握手(建立连接)。3. TLS 握手(约定加密)。4. HTTP 请求(请求页面,已加密)。

Which of the following is the most accurate statement about the relationship between the Internet and the Web?以下哪项最准确地描述了互联网与万维网的关系?
§7 · Q1
The Web and the Internet are two different names for the same thing万维网和互联网是同一事物的两个名称
The Internet is a service that runs on top of the Web互联网是运行在万维网之上的一种服务
The Web is one application (HTTP/HTTPS hypertext documents) that runs over the Internet infrastructure万维网是运行在互联网基础设施之上的一种应用(HTTP/HTTPS 超文本文档)
The Web includes all Internet services such as email and file transfer万维网包含电子邮件和文件传输等所有互联网服务
The Internet is the global network infrastructure (TCP/IP, routers, cables). The Web is one application that runs over that infrastructure, using HTTP/HTTPS to transfer hypertext documents. Email, FTP, VoIP, and online gaming are other applications that also run over the same Internet infrastructure; none of them are "the Web."互联网是全球网络基础设施(TCP/IP、路由器、电缆)。万维网是运行在该基础设施上的一种应用,使用 HTTP/HTTPS 传输超文本文档。电子邮件、FTP、VoIP 和在线游戏是运行在同一互联网基础设施上的其他应用,它们都不是"万维网"。
Web ≠ Internet. The Web (HTTP/HTML) is one service on the Internet. The Internet also carries email, FTP, VoIP, etc. The Internet came before the Web (ARPANET 1969; Web 1989).万维网 ≠ 互联网。万维网(HTTP/HTML)是互联网上的一种服务。互联网还承载电子邮件、FTP、VoIP 等。互联网早于万维网(ARPANET 1969;万维网 1989)。
In the URL https://school.ca/grades?term=1, what does https specify?在 URL https://school.ca/grades?term=1 中,https 指定什么?
§7 · Q2
The protocol used to transfer the resource (HTTP with TLS encryption)用于传输资源的协议(带 TLS 加密的 HTTP)
The domain name of the server服务器的域名
The path to the resource on the server服务器上资源的路径
The query string parameters查询字符串参数
The part before :// is the scheme / protocol. https means HTTP with TLS encryption. The domain is school.ca; the path is /grades; the query string is term=1.:// 之前的部分是协议方案。https 表示带 TLS 加密的 HTTP。域名是 school.ca;路径是 /grades;查询字符串是 term=1。
URL structure: scheme://domain/path?query#fragment. The scheme (https) is the protocol. Domain = school.ca. Path = /grades. Query = term=1.URL 结构:协议://域名/路径?查询#片段。协议(https)是方案。域名 = school.ca。路径 = /grades。查询 = term=1。

Exam Strategy and Common Pitfalls考试策略与常见陷阱

Distinguish terms precisely精确区分术语
  • Internet vs Web.互联网与万维网。 Keep these two terms apart. The Internet is the global TCP/IP network; the Web is the HTTP/HTTPS hypertext system running over it. Email, FTP, and online gaming are also Internet services; none of them are "the Web."请把这两个术语分清。互联网是全球 TCP/IP 网络;万维网是运行在其上的 HTTP/HTTPS 超文本系统。电子邮件、FTP 和在线游戏也是互联网服务,它们都不是"万维网"。
  • LAN vs WAN.局域网与广域网。 LAN = one building/campus, privately owned. WAN = spans large distances, connects LANs. The Internet is a WAN (the largest WAN). State both the geographic scope and ownership when asked to distinguish them.局域网 = 一栋建筑/校园,私有。广域网 = 跨越大距离,连接多个局域网。互联网是一个广域网(最大的广域网)。被问到区别时,同时陈述地理范围和所有权。
  • Protocol vs topology.协议与拓扑结构。 A protocol is a set of communication rules (TCP, HTTP). A topology is the physical or logical arrangement of devices (star, mesh). They are different dimensions of network design; mixing them up is a common error.协议是一套通信规则(TCP、HTTP)。拓扑结构是设备的物理或逻辑排布方式(星型、网状型)。它们是网络设计的不同维度,混淆它们是常见错误。
Packets, protocols, and layers (§2–§5)数据包、协议与分层(§2–§5)
  • Explain packets with three benefits.用三个优势解释数据包。 When asked why the Internet uses packet switching, state all three: (1) parallel routing, (2) selective retransmission of lost packets only, (3) fair bandwidth sharing. A one-line answer is incomplete.被问到互联网为何使用分组交换时,说出全部三个优势:(1)并行路由,(2)仅重传丢失的数据包,(3)带宽公平共享。只写一行的答案不完整。
  • TCP vs UDP: always state the use case.TCP 与 UDP:始终陈述使用场景。 For any protocol comparison question, name the protocol, state whether it is reliable or fast, and give a concrete use case (TCP: web pages; UDP: video streaming). Three elements per protocol answer.对于任何协议比较题,命名协议,说明是可靠还是快速,并给出具体使用场景(TCP:网页;UDP:视频流)。每个协议答案包含三要素。
  • OSI layer numbers matter (BC CIS).OSI 层编号很重要(BC CIS)。 In BC CIS, know all seven layer names and numbers. In AP CSP, understand the conceptual purpose of layering (each layer does one job and hides complexity from the layers above), which matters more than memorising all seven names.在 BC CIS 中,熟记全部七层的名称和编号。在 AP CSP 中,理解分层的概念目的(每层做一件事,向上层隐藏复杂性),比死记全部七层名称更重要。
Security (§6): always name the tradeoff安全(§6):始终说明权衡
  • Name the malware type correctly.正确命名恶意软件类型。 Virus ≠ worm ≠ Trojan. On Ontario ICS3U C2.2 questions, be specific: a worm self-replicates across the network; a Trojan disguises itself; ransomware encrypts files for payment. Calling all malware a "virus" is too vague.病毒 ≠ 蠕虫 ≠ 木马。在安大略 ICS3U C2.2 题目中要具体:蠕虫在网络中自我复制;木马伪装自身;勒索软件加密文件索取赎金。把所有恶意软件笼统称为"病毒"不够准确。
  • Security recommendation format (CSTA 3A-NI-06 to 3A-NI-08).安全建议格式(CSTA 3A-NI-06 至 3A-NI-08)。 A complete recommendation states the threat, the recommended measure, and the tradeoff (e.g., "Implement MFA: it reduces account compromise but adds a login step for every user"). The tradeoff is what CSTA 3A-NI-08 asks you to explain.完整的建议要陈述威胁、推荐措施和权衡(如"实施 MFA:降低账户泄露风险,但每个用户每次登录需额外步骤")。权衡正是 CSTA 3A-NI-08 要求你解释的内容。
Answer hygiene作答规范
  • Use the correct technical term, not synonyms.使用正确的技术术语,而非同义词。 "Packet" not "chunk." "Protocol" not "rule." "Topology" not "layout." "Client-server" not "request-response pair" (unless the question uses that phrasing). Precise vocabulary makes an answer clear and checkable."数据包"而非"块"。"协议"而非"规则"。"拓扑结构"而非"布局"。"客户端-服务器"而非"请求-响应对"(除非题目使用该措辞)。精确的词汇让答案清晰、可核对。
  • Draw the diagram if the question allows.如果题目允许,画出图示。 For a star topology question, a labelled sketch (central switch, labelled device nodes, arrows) is usually clearer than a paragraph. For a "name the layers" question, an OSI table (layer number | name | example protocol) is clearer than prose.拓扑结构题中,标注的草图(中央交换机、标注的设备节点、箭头)通常比段落更清楚。对于"命名各层"的题目,OSI 表格(层编号 | 名称 | 示例协议)比文字更清楚。

Flashcards闪卡

0 / 14 flipped0 / 14 已翻
LAN vs WAN局域网与广域网
LAN = Local Area Network: one building/campus, private. WAN = Wide Area Network: spans large distances, connects LANs. The Internet is the largest WAN.LAN = 局域网:一栋建筑/校园,私有。WAN = 广域网:跨越大距离,连接多个局域网。互联网是最大的广域网。
What is a packet?什么是数据包?
A small chunk of data (typically ≤1,500 bytes) with a header containing source IP, destination IP, sequence number, and total packet count. Data is broken into packets for transmission.一小块数据(通常 ≤1,500 字节),头部包含源 IP、目标 IP、序列号和总包数。数据被拆分为数据包进行传输。
Star topology星型拓扑
All devices connect to a central switch/router. Most common in modern LANs. Single point of failure: if the switch fails, all devices lose connectivity.所有设备连接到中央交换机/路由器。现代局域网最常见。单点故障:若交换机故障,所有设备失去连接。
Mesh topology: why fault tolerant?网状拓扑:为何容错?
Every device connects to every other. Multiple paths exist between any two nodes; if one link fails, data reroutes. The Internet uses a mesh-like structure for this reason.每台设备与其他所有设备相连。任意两节点间有多条路径,某条链路故障时数据重新路由。互联网正因此采用类似网状结构。
DNS域名系统
Domain Name System: translates human-readable domain names (e.g. google.com) into IP addresses routers can use. The Internet's "phone book." Hierarchical and distributed.域名系统:将人类可读的域名(如 google.com)翻译成路由器可使用的 IP 地址。互联网的"电话簿"。层级化且分布式。
TCP vs UDPTCP 与 UDP
TCP: reliable, ordered, connection (3-way handshake), ACK + retransmit. Used for HTTP, email, files. UDP: fast, connectionless, no ACK. Used for video streaming, VoIP, gaming.TCP:可靠、有序、面向连接(三次握手)、ACK + 重传。用于 HTTP、电子邮件、文件。UDP:快速、无连接、无 ACK。用于视频流、VoIP、游戏。
What does HTTPS add over HTTP?HTTPS 在 HTTP 基础上增加什么?
TLS (Transport Layer Security) encryption. Data between browser and server is encrypted; eavesdroppers on the network see only ciphertext, not passwords or card numbers.TLS(传输层安全)加密。浏览器与服务器之间的数据被加密,网络上的窃听者只看到密文,而非密码或卡号。
OSI Layer 3 and Layer 4OSI 第 3 层和第 4 层
Layer 3 = Network: IP; addresses and routes packets between networks. Layer 4 = Transport: TCP/UDP; end-to-end delivery, ports, reliability (TCP) or speed (UDP).第 3 层 = 网络层:IP,在网络间寻址和路由数据包。第 4 层 = 传输层:TCP/UDP,端到端传输、端口、可靠性(TCP)或速度(UDP)。
OSI 7 layers (7→1)OSI 七层(7→1)
7 Application · 6 Presentation · 5 Session · 4 Transport · 3 Network · 2 Data Link · 1 Physical. Mnemonic: All People Seem To Need Data Processing.7 应用层 · 6 表示层 · 5 会话层 · 4 传输层 · 3 网络层 · 2 数据链路层 · 1 物理层。记忆口诀:应用表示会话传网数物。
Firewall防火墙
Hardware or software that monitors and controls network traffic based on rules. Blocks unauthorised connections; allows legitimate traffic. Tradeoff: may block legitimate services if misconfigured.根据规则监控和控制网络流量的硬件或软件。阻止未授权连接;允许合法流量。权衡:配置错误可能阻止合法服务。
Worm vs virus vs Trojan蠕虫 vs 病毒 vs 木马
Virus: attaches to a host file; spreads when file is shared. Worm: self-replicates across network; no host file needed. Trojan: disguised as legitimate software; does not self-replicate. ON ICS3U C2.2.病毒:附着于宿主文件;文件共享时传播。蠕虫:在网络中自我复制,无需宿主文件。木马:伪装成合法软件;不自我复制。安大略 ICS3U C2.2。
Internet vs Web互联网与万维网
Internet = global TCP/IP network infrastructure (cables, routers, protocols). Web = one application on the Internet using HTTP/HTTPS to transfer hypertext documents. Email, FTP, VoIP are other Internet services, not "the Web."互联网 = 全球 TCP/IP 网络基础设施(电缆、路由器、协议)。万维网 = 互联网上的一种应用,使用 HTTP/HTTPS 传输超文本文档。电子邮件、FTP、VoIP 是其他互联网服务,不是"万维网"。
Client-server model客户端-服务器模型
Client sends a request (e.g. browser sends HTTP GET). Server processes and sends a response (e.g. HTML page). AB CSE1210/1220 introduce "Internet computing" via this model. Used by every website.客户端发送请求(如浏览器发送 HTTP GET)。服务器处理并返回响应(如 HTML 页面)。AB CSE1210/1220 通过此模型介绍"互联网计算"。每个网站都使用此模型。
IPv4 vs IPv6IPv4 与 IPv6
IPv4: 32-bit, ~4.3 billion addresses, written as 4 decimal octets (e.g. 192.168.1.1). IPv6: 128-bit, ~3.4×10³⁸ addresses, written in hex with colons. Moved to IPv6 because IPv4 addresses were nearly exhausted.IPv4:32 位,约 43 亿个地址,以 4 个十进制数字书写(如 192.168.1.1)。IPv6:128 位,约 3.4×10³⁸ 个地址,以十六进制加冒号书写。迁移到 IPv6 是因为 IPv4 地址几近耗尽。

Practice Quiz综合测验

A student connects their laptop to a school printer and server all through one central switch. Which network type and topology does this describe?一名学生通过一台中央交换机将笔记本电脑连接到学校打印机和服务器。这描述了哪种网络类型和拓扑结构?
Q1
WAN / mesh广域网 / 网状型
WAN / bus广域网 / 总线型
LAN / ring局域网 / 环型
LAN / star局域网 / 星型
One building/campus = LAN. All devices through one central switch = star topology. CSTA 3A-NI-04: "relationship between routers, switches, servers, topology, and addressing."一栋建筑/校园 = 局域网。所有设备通过一台中央交换机 = 星型拓扑。CSTA 3A-NI-04:"路由器、交换机、服务器、拓扑结构和寻址之间的关系。"
One building = LAN (not WAN). One central switch = star (not mesh, ring, or bus).一栋建筑 = 局域网(非广域网)。一台中央交换机 = 星型(非网状、环型或总线型)。
A 10 MB file is sent as 7,000 packets. Packet 4,532 is lost in transit. What happens next?一个 10 MB 的文件被拆分为 7,000 个数据包发送。数据包 4,532 在传输中丢失。接下来会发生什么?
Q2
Only packet 4,532 is retransmitted; the rest of the file is unaffected只重传数据包 4,532;文件其余部分不受影响
All 7,000 packets are retransmitted from the beginning全部 7,000 个数据包从头重传
The file transfer fails permanently文件传输永久失败
The receiver reconstructs the missing packet from the other packets接收方从其他数据包重建丢失的数据包
TCP tracks sequence numbers and sends acknowledgements (ACK) for each packet. If packet 4,532 is not acknowledged, only that packet is retransmitted; selective retransmission is one of TCP's key advantages over sending one continuous stream.TCP 追踪序列号并对每个数据包发送确认(ACK)。若数据包 4,532 未被确认,只重传该数据包,选择性重传是 TCP 相较于连续流传输的关键优势之一。
TCP uses selective retransmission: only the missing packet is resent. This is one of the three key reasons the Internet uses packet switching.TCP 使用选择性重传,只重传丢失的数据包。这是互联网使用分组交换的三大关键原因之一。
You type https://school.ca. In what order do the following steps occur: (A) TCP 3-way handshake, (B) DNS lookup, (C) TLS handshake, (D) HTTP GET request?你输入 https://school.ca。以下步骤的发生顺序是什么:(A)TCP 三次握手,(B)DNS 查找,(C)TLS 握手,(D)HTTP GET 请求?
Q3
A → B → C → DA → B → C → D
D → C → B → AD → C → B → A
B → A → C → DB → A → C → D
C → B → A → DC → B → A → D
DNS resolves the domain name to an IP first (B). Then TCP establishes the connection with a 3-way handshake (A). TLS is negotiated over the TCP connection (C). Finally the HTTP GET request is sent encrypted (D).DNS 先将域名解析为 IP(B)。然后 TCP 通过三次握手建立连接(A)。TLS 在 TCP 连接上进行协商(C)。最后发送加密的 HTTP GET 请求(D)。
Order: DNS (need IP to connect) → TCP handshake (connection) → TLS handshake (encryption setup) → HTTP request (application data).顺序:DNS(需要 IP 才能连接)→ TCP 握手(建立连接)→ TLS 握手(加密设置)→ HTTP 请求(应用数据)。
Which CSTA standard (verbatim) asks students to "Evaluate the scalability and reliability of networks, by describing the relationship between routers, switches, servers, topology, and addressing"? 🇺🇸 CSTA哪个 CSTA 标准(原文)要求学生"通过描述路由器、交换机、服务器、拓扑结构和寻址之间的关系,评估网络的可扩展性和可靠性"?🇺🇸 CSTA
Q4
3A-NI-05
3A-NI-04
3A-NI-07
3B-NI-03
CSTA 3A-NI-04 (verbatim): "Evaluate the scalability and reliability of networks, by describing the relationship between routers, switches, servers, topology, and addressing." This is the primary networks-and-topology standard at Level 3A.CSTA 3A-NI-04(原文):"通过描述路由器、交换机、服务器、拓扑结构和寻址之间的关系,评估网络的可扩展性和可靠性。"这是 3A 级最主要的网络与拓扑标准。
3A-NI-04 = scalability/reliability/topology. 3A-NI-05 = sensitive data and malware. 3A-NI-07 = compare security measures. 3B-NI-03 is a Level 3B standard, not 3A.3A-NI-04 = 可扩展性/可靠性/拓扑结构。3A-NI-05 = 敏感数据与恶意软件。3A-NI-07 = 比较安全措施。3B-NI-03 是 3B 级标准,不属于 3A。
BC CIS 11 Content (verbatim) names which two network models? 🇨🇦 BC CISBC CIS 11 内容(原文)命名了哪两种网络模型?🇨🇦 BC CIS
Q5
OSI (seven layers) and TCP/IP (four layers)OSI(七层)和 TCP/IP(四层)
HTTP and HTTPSHTTP 和 HTTPS
LAN and WAN only仅局域网和广域网
IPv4 and IPv6IPv4 和 IPv6
BC CIS 11 Content (verbatim): "seven layers of the Open System Interconnection (OSI) reference model" and "four layers of the Transmission Control Protocol/Internet Protocol (TCP/IP)." Both models are named explicitly; BC CIS 11 goes furthest into protocol detail.BC CIS 11 内容(原文):"OSI 参考模型的七层"和"TCP/IP 的四层"。两种模型均被明确命名,BC CIS 11 在协议细节上走得最深。
BC CIS 11 specifically names OSI (7 layers) and TCP/IP (4 layers) verbatim in its Content standards. HTTP/HTTPS, LAN/WAN, and IPv4/IPv6 are also covered but are not "the two network models" the standard points to.BC CIS 11 在内容标准中原文明确命名 OSI(7 层)和 TCP/IP(4 层)。HTTP/HTTPS、LAN/WAN 和 IPv4/IPv6 也有涉及,但不是该标准指向的"两种网络模型"。
Ontario ICS3U C2.2 covers which of the following? 🇨🇦 ON ICS3U安大略 ICS3U C2.2 涵盖以下哪项?🇨🇦 ON ICS3U
Q6
The OSI seven-layer modelOSI 七层模型
Packet switching and TCP/IP分组交换和 TCP/IP
Star and mesh network topologies星型和网状网络拓扑
Procedures to safeguard data from malware and a system protection plan保护数据免受恶意软件侵害的程序和系统保护计划
ICS3U C2.2 (verbatim): "describe procedures to safeguard data and programs from malware (e.g., viruses, Trojan horses, worms, spyware, adware, malevolent macros), and devise a thorough system protection plan." The other options (OSI, packet switching, topologies) are not part of C2.2.ICS3U C2.2(原文):"描述保护数据和程序免受恶意软件(如病毒、木马、蠕虫、间谍软件、广告软件、恶意宏)侵害的程序,并制定全面的系统保护计划。"其他选项(OSI、分组交换、拓扑结构)不属于 C2.2。
C2.2 is about malware and a system protection plan. OSI, TCP/IP, packet switching, and topologies are other topics in this guide, not part of C2.2.C2.2 讲的是恶意软件和系统保护计划。OSI、TCP/IP、分组交换和拓扑结构是本指南中的其他主题,不属于 C2.2。

Readiness Checklist准备就绪清单

Tick each item when you can do it cold, without notes, on a first attempt.能在无笔记、首次尝试下完成,再勾选每一项。

0 / 11 mastered已掌握 0 / 11

What This Feeds Into本单元的去向

Networks and the Internet underpins three major downstream areas. First, the cybersecurity and ethics unit (Unit 12) extends the security concepts in §6: you will go from understanding what a firewall does to evaluating legal, ethical, and societal implications of computing security decisions. Second, AP CSP Big Idea 4 (Computer Systems & Networks) matches this unit's content closely, so if you are taking AP CSP, this guide is core reading. Third, the web-scripting pathway (AB CSE1210/1220; any school teaching HTML/CSS/JavaScript) builds directly on the client-server and HTTP foundations in §7.网络与互联网为三大下游领域奠定基础。第一,网络安全与伦理单元(第 12 单元)扩展了 §6 中的安全概念:你将从理解防火墙的作用,进阶到评估计算安全决策的法律、伦理和社会影响。第二,AP CSP 大概念 4(计算机系统与网络)与本单元内容高度对应,若你学习 AP CSP,本指南是核心读物。第三,Web 脚本路径(AB CSE1210/1220;任何教授 HTML/CSS/JavaScript 的学校)直接建立在 §7 中客户端-服务器和 HTTP 基础之上。

Within High School Computer Science.在 HS Computer Science 内部。

Unit 12 (Cybersecurity, Ethics and Society) is the natural continuation of §6 (Network Security Basics); CSTA 3A-NI-05 through 3A-NI-08 and the malware taxonomy all feed directly into that unit. Unit 10 (Data, Databases and the Web) pairs with §7 of this guide: understanding how HTTP carries data between browser and server is a prerequisite for understanding web forms, APIs, and database queries. The Boolean Logic unit (Unit 9) connects at Layer 2 (Data Link); understanding that all data is ultimately bits on a wire ties number systems to physical networking.第 12 单元(网络安全、伦理与社会)是 §6(网络安全基础)的自然延伸,CSTA 3A-NI-05 至 3A-NI-08 以及恶意软件分类法都直接延伸至该单元。第 10 单元(数据、数据库与 Web)与本指南的 §7 配套:理解 HTTP 如何在浏览器与服务器之间传输数据,是理解网络表单、API 和数据库查询的前提。布尔逻辑单元(第 9 单元)在第 2 层(数据链路层)相连,理解所有数据最终都是线路上的比特,将数字系统与物理网络联系起来。

AP and downstream connections.AP 及下游连接。

AP CSA has no networks unit (it focuses on Java OOP and does not cover network protocols). The primary AP feeder is AP CSP Big Idea 4 (CSN). If you are on the AP CSP track, focus on §2 (packets), §4 (TCP/IP, HTTP), and §6 (security tradeoffs); these map to the CSN Learning Objectives CSN-1.A through CSN-1.E in the AP CSP course. BC CIS students heading into network administration or IT programs will find §5 (OSI model) the most directly applicable, as it maps verbatim to the CIS 11 Content standards.AP CSA 没有网络单元(它专注于 Java 面向对象,不涉及网络协议)。主要的 AP 衔接是 AP CSP 大概念 4(CSN)。若你在 AP CSP 轨道上,重点学习 §2(数据包)、§4(TCP/IP、HTTP)和 §6(安全权衡),这些对应 AP CSP 课程中的 CSN 学习目标 CSN-1.A 至 CSN-1.E。计划进入网络管理或 IT 专业的 BC CIS 学生会发现 §5(OSI 模型)最直接适用,因为它与 CIS 11 内容标准原文对应。

This is the ladder we coach students up: from these high school foundations into AP and IB, and on to first-year university. If you would rather have a guide for the next step than take it on trust, Dingrui Scholars tutors teach exactly this path in one-on-one sessions and small-group classes. A free assessment is the place to start.这正是我们陪伴学生攀登的阶梯:从这些高中基础,迈入 AP 与 IB,再走向大学一年级。如果你希望在下一步有人引路,而不是凭感觉前行,Dingrui Scholars 的导师正是沿着这条路径,以一对一辅导与小班课授课。欢迎从免费评估开始。

Common Questions常见问题

What is the difference between the Internet and the Web?互联网和万维网有什么区别?

The Internet is a global network of networks that uses TCP/IP to route packets and carries many services, while the Web is just one of those services, a system of interlinked hypertext pages accessed over HTTP/HTTPS using URLs. The Web runs on top of the Internet.互联网是使用 TCP/IP 路由数据包的全球网络之网,承载着许多服务;万维网只是其中一种服务,是通过 HTTP/HTTPS 用网址访问的相互链接的超文本页面系统。万维网运行在互联网之上。

How does data travel across the Internet in packets?数据是如何以数据包形式在互联网上传输的?

Data is broken into small packets, typically 1,500 bytes or less, each carrying a header with the source and destination IP addresses and packet numbers. Each packet can take a different route, and they are reassembled in order at the destination.数据被拆成小的数据包,通常不超过 1500 字节,每个包的头部带有源 IP 地址、目标 IP 地址和包编号。每个包可以走不同的路由,到达目的地后再按顺序重新组装。

What is the difference between TCP and UDP?TCP 和 UDP 有什么区别?

TCP adds reliability on top of IP by using a handshake, numbering packets, requiring acknowledgements, and retransmitting lost packets, so it suits web pages and email. UDP is fast but unreliable with no handshake or retransmission, which suits video streaming and gaming where speed beats accuracy.TCP 在 IP 之上增加可靠性,使用握手、给数据包编号、要求确认并重传丢失的包,因此适合网页和电子邮件。UDP 快但不可靠,没有握手也不重传,适合速度优先于准确性的视频流和游戏。

Syllabus alignment & how to use this guide大纲对照与使用说明

How to use this guide如何使用本指南

Networks and the Internet is covered at very different depth across the four curricula. AP CSP Big Idea 4 (Computer Systems & Networks) is the closest match: you need to explain packets, protocols, fault tolerance, and the Internet's structure. BC's Computer Information Systems 11/12 stream goes deepest on infrastructure: OSI seven-layer model, TCP/IP four-layer model, WAN/LAN, topologies, and network management. Ontario's university stream (ICS3U/ICS4U) is the lightest: only malware protection (C2.2) is named; protocol and topology content appears in the Grade 10 open course and the college stream. Alberta CSE covers the Internet only through Web scripting modules; protocol/topology content sits in the separate NET cluster.网络与互联网在四套大纲中的涉及深度差异很大。AP CSP 大概念 4(计算机系统与网络)最为对应:需要解释数据包、协议、容错和互联网结构。BC 的 CIS 11/12 方向对基础设施要求最深:OSI 七层模型、TCP/IP 四层模型、WAN/LAN、拓扑结构和网络管理。安大略大学方向(ICS3U/ICS4U)最轻:仅点名恶意软件防护(C2.2);协议和拓扑内容出现在 10 年级公开课和大专方向中。阿尔伯塔 CSE 仅通过 Web 脚本模块涉及互联网;协议/拓扑内容属于独立的 NET 模块群。

If you are in…如果你在… Focus on these sections重点学习 Lighter / context only较轻 / 仅作背景 Source依据
🇺🇸 US CSTA / AP CSP美国 CSTA / AP CSP §1–§7 in full. AP CSP Big Idea 4 (CSN-1.A through CSN-1.E) covers Internet structure, packets, protocols, and fault tolerance. CSTA 3A-NI-04 to 3A-NI-08 add scalability, security, and tradeoffs.§1 至 §7 完整学习。AP CSP 大概念 4(CSN-1.A 至 CSN-1.E)涵盖互联网结构、数据包、协议和容错。CSTA 3A-NI-04 至 3A-NI-08 增加可扩展性、安全性和权衡。 OSI layer detail in §5 going-deeper is context for AP CSP; what matters for AP CSP is the idea of layers, not the order of their names.§5 深入中的 OSI 层详情对 AP CSP 为背景知识;对 AP CSP 而言,重要的是分层的思想,而不是各层名称的顺序。 CSTA K-12 and AP CSP: CSTA 3A-NI-04 through 3A-NI-08; AP CSP Big Idea 4 (CSN) topics 4.1, 4.2, 4.3CSTA 3A-NI-04 至 3A-NI-08;AP CSP 大概念 4(CSN)主题 4.1、4.2、4.3
🇨🇦 ON Grade 11: ICS3U安大略 11 年级:ICS3U §6 (security basics, malware) is the main content here and matches ICS3U C2.2 directly. §1 (LAN/WAN) and §7 (Web vs Internet) as background literacy.§6(安全基础、恶意软件)是主要内容,直接对应 ICS3U C2.2。§1(LAN/WAN)和 §7(Web 与互联网)作为背景知识。 Protocol depth in §4 and the OSI model in §5 are not part of the ICS3U/ICS4U university stream; treat them as enrichment.§4 的协议深度和 §5 的 OSI 模型不属于 ICS3U/ICS4U 大学方向,作为拓展内容。 ON/BC Computer Studies 11-12: ICS3U Strand C C2.2; ICS3C C1.4; ICS2O A4ICS3U C 单元 C2.2;ICS3C C1.4;ICS2O A4
🇨🇦 BC: CIS 11 / CIS 12BC: CIS 11 / CIS 12 §1–§7 in full. CIS 11 Content names OSI seven layers, TCP/IP four layers, WAN/LAN, topologies, and "key aspects of network protocols and standards" verbatim. CIS 12 adds deployment, maintenance, and security management.§1 至 §7 完整学习。CIS 11 内容原文命名 OSI 七层、TCP/IP 四层、WAN/LAN、拓扑结构和"网络协议和标准的关键方面"。CIS 12 增加部署、维护和安全管理。 CIS 12 network-device design and remote-access tools are beyond this guide's scope; see the CIS 12 course page.CIS 12 网络设备设计和远程访问工具超出本指南范围,参见 CIS 12 课程页面。 ON/BC Computer Studies 11-12: BC CS10 networking Content; CIS 11 network planning / OSI / TCP/IP Content; CIS 12 deployment ContentBC CS10 网络内容;CIS 11 网络规划 / OSI / TCP/IP 内容;CIS 12 部署内容
🇨🇦 AB: CSE scripting / NET cluster阿尔伯塔:CSE 脚本 / NET 模块群 §7 (the Web, client-server, URLs) maps to CSE1210/CSE1220 (Client-side Scripting 1 & 2) which "introduce Internet computing." §1 (LAN/WAN) and §6 (security) as background literacy for any computing course.§7(Web、客户端-服务器、URL)对应 CSE1210/CSE1220(客户端脚本 1 和 2),它们"介绍互联网计算"。§1(LAN/WAN)和 §6(安全)作为任何计算课程的背景知识。 Protocol and OSI layer detail (§4, §5) are in the NET cluster, not CSE; treat as enrichment for CSE students.协议和 OSI 层详情(§4、§5)属于 NET 模块群,不属于 CSE,对 CSE 学生作为拓展内容。 Alberta CTS Computing Science: CSE1210, CSE1220 descriptions; NET cluster noteCSE1210、CSE1220 描述;NET 模块群说明
!
If you are cramming the night before如果你在临阵磨枪

Memorise five things: what a packet is and why data travels in packets; what IP addresses and DNS do; the difference between TCP and UDP (reliable vs fast); what HTTP vs HTTPS means; and what a firewall does. Read every cram-cheat box. Skip the OSI seven-layer name list in the going-deeper box unless you are in BC CIS.背熟五件事:什么是数据包以及为什么数据以数据包传输;IP地址和DNS的作用;TCP 与 UDP 的区别(可靠 vs 快速);HTTP 与 HTTPS 的含义;防火墙的作用。读每个速记框,除非你在 BC CIS,否则跳过深入框中的 OSI 七层名称列表。

*
If you are going for the top mark如果你目标顶分

For AP CSP: understand how packets are routed, why the Internet is fault-tolerant (multiple paths), and the tradeoff between reliability (TCP) and speed (UDP). For BC CIS: know all seven OSI layers by name and function, the four TCP/IP layers, and the difference between logical and physical topologies. For all curricula: be able to explain why HTTPS is more secure than HTTP, and what a firewall does.AP CSP 要求:理解数据包如何路由、为什么互联网具有容错性(多路径),以及可靠性(TCP)与速度(UDP)的权衡。BC CIS 要求:按名称和功能熟知 OSI 七层、TCP/IP 四层,以及逻辑拓扑与物理拓扑的区别。所有大纲要求:能解释为什么 HTTPS 比 HTTP 更安全,以及防火墙的作用。